blob: 91364b2487ac6eea3a9fd6afdb064bac53a87dd3 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="bigquery_v2.html">BigQuery API</a> . <a href="bigquery_v2.routines.html">routines</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#delete">delete(projectId, datasetId, routineId)</a></code></p>
79<p class="firstline">Deletes the routine specified by routineId from the dataset.</p>
80<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#get">get(projectId, datasetId, routineId, readMask=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070082<p class="firstline">Gets the specified routine resource by routine ID.</p>
83<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070084 <code><a href="#insert">insert(projectId, datasetId, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070085<p class="firstline">Creates a new routine in the dataset.</p>
86<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#list">list(projectId, datasetId, filter=None, pageToken=None, maxResults=None, readMask=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070088<p class="firstline">Lists all routines in the specified dataset. Requires the READER dataset</p>
89<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#update">update(projectId, datasetId, routineId, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<p class="firstline">Updates information in an existing routine. The update method replaces the</p>
95<h3>Method Details</h3>
96<div class="method">
97 <code class="details" id="delete">delete(projectId, datasetId, routineId)</code>
98 <pre>Deletes the routine specified by routineId from the dataset.
99
100Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700101 projectId: string, Required. Project ID of the routine to delete (required)
102 datasetId: string, Required. Dataset ID of the routine to delete (required)
103 routineId: string, Required. Routine ID of the routine to delete (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700104</pre>
105</div>
106
107<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700108 <code class="details" id="get">get(projectId, datasetId, routineId, readMask=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109 <pre>Gets the specified routine resource by routine ID.
110
111Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700112 projectId: string, Required. Project ID of the requested routine (required)
113 datasetId: string, Required. Dataset ID of the requested routine (required)
114 routineId: string, Required. Routine ID of the requested routine (required)
115 readMask: string, If set, only the Routine fields in the field mask are returned in the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700116response. If unset, all Routine fields are returned.
117
118Returns:
119 An object of the form:
120
121 { # A user-defined function or a stored procedure.
Dan O'Mearadd494642020-05-01 07:42:23 -0700122 "routineType": "A String", # Required. The type of routine.
123 "description": "A String", # Optional. [Experimental] The description of the routine if defined.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700124 "language": "A String", # Optional. Defaults to "SQL".
125 "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since
126 # the epoch.
127 "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the
128 # imported JAVASCRIPT libraries.
129 "A String",
130 ],
131 "routineReference": { # Required. Reference describing the ID of this routine.
132 "projectId": "A String", # [Required] The ID of the project containing this routine.
133 "routineId": "A String", # [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters.
134 "datasetId": "A String", # [Required] The ID of the dataset containing this routine.
135 },
136 "etag": "A String", # Output only. A hash of this resource.
137 "arguments": [ # Optional.
138 { # Input/output argument of a function or a stored procedure.
139 "dataType": { # The type of a variable, e.g., a function argument. # Required unless argument_kind = ANY_TYPE.
140 # Examples:
141 # INT64: {type_kind="INT64"}
Dan O'Mearadd494642020-05-01 07:42:23 -0700142 # ARRAY&lt;STRING&gt;: {type_kind="ARRAY", array_element_type="STRING"}
143 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700144 # {type_kind="STRUCT",
145 # struct_type={fields=[
146 # {name="x", type={type_kind="STRING"}},
147 # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}}
148 # ]}}
149 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT".
150 "fields": [
151 # Object with schema name: StandardSqlField
152 ],
153 },
154 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY".
155 "typeKind": "A String", # Required. The top level type of this field.
156 # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
157 },
158 "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE.
Dan O'Mearadd494642020-05-01 07:42:23 -0700159 "name": "A String", # Optional. The name of this argument. Can be absent for function return argument.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700160 "mode": "A String", # Optional. Specifies whether the argument is input or output.
161 # Can be set for procedures only.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700162 },
163 ],
164 "returnType": { # The type of a variable, e.g., a function argument. # Optional if language = "SQL"; required otherwise.
Dan O'Mearadd494642020-05-01 07:42:23 -0700165 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700166 # If absent, the return type is inferred from definition_body at query time
167 # in each query that references this routine. If present, then the evaluated
168 # result will be cast to the specified returned type at query time.
169 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700170 # For example, for the functions created with the following statements:
171 #
172 # * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);`
173 #
174 # * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));`
175 #
176 # * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));`
177 #
178 # The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and
179 # is absent for `Increment` (inferred as FLOAT64 at query time).
180 #
181 # Suppose the function `Add` is replaced by
182 # `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);`
183 #
184 # Then the inferred return type of `Increment` is automatically changed to
185 # INT64 at query time, while the return type of `Decrement` remains FLOAT64.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700186 # Examples:
187 # INT64: {type_kind="INT64"}
Dan O'Mearadd494642020-05-01 07:42:23 -0700188 # ARRAY&lt;STRING&gt;: {type_kind="ARRAY", array_element_type="STRING"}
189 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700190 # {type_kind="STRUCT",
191 # struct_type={fields=[
192 # {name="x", type={type_kind="STRING"}},
193 # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}}
194 # ]}}
195 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT".
196 "fields": [
197 # Object with schema name: StandardSqlField
198 ],
199 },
200 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY".
201 "typeKind": "A String", # Required. The top level type of this field.
202 # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
203 },
204 "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds
205 # since the epoch.
206 "definitionBody": "A String", # Required. The body of the routine.
Dan O'Mearadd494642020-05-01 07:42:23 -0700207 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700208 # For functions, this is the expression in the AS clause.
Dan O'Mearadd494642020-05-01 07:42:23 -0700209 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700210 # If language=SQL, it is the substring inside (but excluding) the
211 # parentheses. For example, for the function created with the following
Dan O'Mearadd494642020-05-01 07:42:23 -0700212 # statement:
213 #
214 # `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))`
215 #
216 # The definition_body is `concat(x, "\n", y)` (\n is not replaced with
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700217 # linebreak).
Dan O'Mearadd494642020-05-01 07:42:23 -0700218 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700219 # If language=JAVASCRIPT, it is the evaluated string in the AS clause.
Dan O'Mearadd494642020-05-01 07:42:23 -0700220 # For example, for the function created with the following statement:
221 #
222 # `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'`
223 #
224 # The definition_body is
225 #
226 # `return "\n";\n`
227 #
228 # Note that both \n are replaced with linebreaks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700229 }</pre>
230</div>
231
232<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700233 <code class="details" id="insert">insert(projectId, datasetId, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700234 <pre>Creates a new routine in the dataset.
235
236Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700237 projectId: string, Required. Project ID of the new routine (required)
238 datasetId: string, Required. Dataset ID of the new routine (required)
239 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700240 The object takes the form of:
241
242{ # A user-defined function or a stored procedure.
Dan O'Mearadd494642020-05-01 07:42:23 -0700243 "routineType": "A String", # Required. The type of routine.
244 "description": "A String", # Optional. [Experimental] The description of the routine if defined.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700245 "language": "A String", # Optional. Defaults to "SQL".
246 "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since
247 # the epoch.
248 "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the
249 # imported JAVASCRIPT libraries.
250 "A String",
251 ],
252 "routineReference": { # Required. Reference describing the ID of this routine.
253 "projectId": "A String", # [Required] The ID of the project containing this routine.
254 "routineId": "A String", # [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters.
255 "datasetId": "A String", # [Required] The ID of the dataset containing this routine.
256 },
257 "etag": "A String", # Output only. A hash of this resource.
258 "arguments": [ # Optional.
259 { # Input/output argument of a function or a stored procedure.
260 "dataType": { # The type of a variable, e.g., a function argument. # Required unless argument_kind = ANY_TYPE.
261 # Examples:
262 # INT64: {type_kind="INT64"}
Dan O'Mearadd494642020-05-01 07:42:23 -0700263 # ARRAY&lt;STRING&gt;: {type_kind="ARRAY", array_element_type="STRING"}
264 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700265 # {type_kind="STRUCT",
266 # struct_type={fields=[
267 # {name="x", type={type_kind="STRING"}},
268 # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}}
269 # ]}}
270 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT".
271 "fields": [
272 # Object with schema name: StandardSqlField
273 ],
274 },
275 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY".
276 "typeKind": "A String", # Required. The top level type of this field.
277 # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
278 },
279 "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE.
Dan O'Mearadd494642020-05-01 07:42:23 -0700280 "name": "A String", # Optional. The name of this argument. Can be absent for function return argument.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700281 "mode": "A String", # Optional. Specifies whether the argument is input or output.
282 # Can be set for procedures only.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700283 },
284 ],
285 "returnType": { # The type of a variable, e.g., a function argument. # Optional if language = "SQL"; required otherwise.
Dan O'Mearadd494642020-05-01 07:42:23 -0700286 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700287 # If absent, the return type is inferred from definition_body at query time
288 # in each query that references this routine. If present, then the evaluated
289 # result will be cast to the specified returned type at query time.
290 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700291 # For example, for the functions created with the following statements:
292 #
293 # * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);`
294 #
295 # * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));`
296 #
297 # * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));`
298 #
299 # The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and
300 # is absent for `Increment` (inferred as FLOAT64 at query time).
301 #
302 # Suppose the function `Add` is replaced by
303 # `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);`
304 #
305 # Then the inferred return type of `Increment` is automatically changed to
306 # INT64 at query time, while the return type of `Decrement` remains FLOAT64.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700307 # Examples:
308 # INT64: {type_kind="INT64"}
Dan O'Mearadd494642020-05-01 07:42:23 -0700309 # ARRAY&lt;STRING&gt;: {type_kind="ARRAY", array_element_type="STRING"}
310 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700311 # {type_kind="STRUCT",
312 # struct_type={fields=[
313 # {name="x", type={type_kind="STRING"}},
314 # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}}
315 # ]}}
316 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT".
317 "fields": [
318 # Object with schema name: StandardSqlField
319 ],
320 },
321 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY".
322 "typeKind": "A String", # Required. The top level type of this field.
323 # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
324 },
325 "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds
326 # since the epoch.
327 "definitionBody": "A String", # Required. The body of the routine.
Dan O'Mearadd494642020-05-01 07:42:23 -0700328 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700329 # For functions, this is the expression in the AS clause.
Dan O'Mearadd494642020-05-01 07:42:23 -0700330 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700331 # If language=SQL, it is the substring inside (but excluding) the
332 # parentheses. For example, for the function created with the following
Dan O'Mearadd494642020-05-01 07:42:23 -0700333 # statement:
334 #
335 # `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))`
336 #
337 # The definition_body is `concat(x, "\n", y)` (\n is not replaced with
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700338 # linebreak).
Dan O'Mearadd494642020-05-01 07:42:23 -0700339 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700340 # If language=JAVASCRIPT, it is the evaluated string in the AS clause.
Dan O'Mearadd494642020-05-01 07:42:23 -0700341 # For example, for the function created with the following statement:
342 #
343 # `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'`
344 #
345 # The definition_body is
346 #
347 # `return "\n";\n`
348 #
349 # Note that both \n are replaced with linebreaks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700350 }
351
352
353Returns:
354 An object of the form:
355
356 { # A user-defined function or a stored procedure.
Dan O'Mearadd494642020-05-01 07:42:23 -0700357 "routineType": "A String", # Required. The type of routine.
358 "description": "A String", # Optional. [Experimental] The description of the routine if defined.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700359 "language": "A String", # Optional. Defaults to "SQL".
360 "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since
361 # the epoch.
362 "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the
363 # imported JAVASCRIPT libraries.
364 "A String",
365 ],
366 "routineReference": { # Required. Reference describing the ID of this routine.
367 "projectId": "A String", # [Required] The ID of the project containing this routine.
368 "routineId": "A String", # [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters.
369 "datasetId": "A String", # [Required] The ID of the dataset containing this routine.
370 },
371 "etag": "A String", # Output only. A hash of this resource.
372 "arguments": [ # Optional.
373 { # Input/output argument of a function or a stored procedure.
374 "dataType": { # The type of a variable, e.g., a function argument. # Required unless argument_kind = ANY_TYPE.
375 # Examples:
376 # INT64: {type_kind="INT64"}
Dan O'Mearadd494642020-05-01 07:42:23 -0700377 # ARRAY&lt;STRING&gt;: {type_kind="ARRAY", array_element_type="STRING"}
378 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700379 # {type_kind="STRUCT",
380 # struct_type={fields=[
381 # {name="x", type={type_kind="STRING"}},
382 # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}}
383 # ]}}
384 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT".
385 "fields": [
386 # Object with schema name: StandardSqlField
387 ],
388 },
389 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY".
390 "typeKind": "A String", # Required. The top level type of this field.
391 # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
392 },
393 "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE.
Dan O'Mearadd494642020-05-01 07:42:23 -0700394 "name": "A String", # Optional. The name of this argument. Can be absent for function return argument.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700395 "mode": "A String", # Optional. Specifies whether the argument is input or output.
396 # Can be set for procedures only.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700397 },
398 ],
399 "returnType": { # The type of a variable, e.g., a function argument. # Optional if language = "SQL"; required otherwise.
Dan O'Mearadd494642020-05-01 07:42:23 -0700400 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700401 # If absent, the return type is inferred from definition_body at query time
402 # in each query that references this routine. If present, then the evaluated
403 # result will be cast to the specified returned type at query time.
404 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700405 # For example, for the functions created with the following statements:
406 #
407 # * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);`
408 #
409 # * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));`
410 #
411 # * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));`
412 #
413 # The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and
414 # is absent for `Increment` (inferred as FLOAT64 at query time).
415 #
416 # Suppose the function `Add` is replaced by
417 # `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);`
418 #
419 # Then the inferred return type of `Increment` is automatically changed to
420 # INT64 at query time, while the return type of `Decrement` remains FLOAT64.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700421 # Examples:
422 # INT64: {type_kind="INT64"}
Dan O'Mearadd494642020-05-01 07:42:23 -0700423 # ARRAY&lt;STRING&gt;: {type_kind="ARRAY", array_element_type="STRING"}
424 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700425 # {type_kind="STRUCT",
426 # struct_type={fields=[
427 # {name="x", type={type_kind="STRING"}},
428 # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}}
429 # ]}}
430 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT".
431 "fields": [
432 # Object with schema name: StandardSqlField
433 ],
434 },
435 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY".
436 "typeKind": "A String", # Required. The top level type of this field.
437 # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
438 },
439 "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds
440 # since the epoch.
441 "definitionBody": "A String", # Required. The body of the routine.
Dan O'Mearadd494642020-05-01 07:42:23 -0700442 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700443 # For functions, this is the expression in the AS clause.
Dan O'Mearadd494642020-05-01 07:42:23 -0700444 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700445 # If language=SQL, it is the substring inside (but excluding) the
446 # parentheses. For example, for the function created with the following
Dan O'Mearadd494642020-05-01 07:42:23 -0700447 # statement:
448 #
449 # `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))`
450 #
451 # The definition_body is `concat(x, "\n", y)` (\n is not replaced with
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700452 # linebreak).
Dan O'Mearadd494642020-05-01 07:42:23 -0700453 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700454 # If language=JAVASCRIPT, it is the evaluated string in the AS clause.
Dan O'Mearadd494642020-05-01 07:42:23 -0700455 # For example, for the function created with the following statement:
456 #
457 # `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'`
458 #
459 # The definition_body is
460 #
461 # `return "\n";\n`
462 #
463 # Note that both \n are replaced with linebreaks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700464 }</pre>
465</div>
466
467<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700468 <code class="details" id="list">list(projectId, datasetId, filter=None, pageToken=None, maxResults=None, readMask=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700469 <pre>Lists all routines in the specified dataset. Requires the READER dataset
470role.
471
472Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700473 projectId: string, Required. Project ID of the routines to list (required)
474 datasetId: string, Required. Dataset ID of the routines to list (required)
475 filter: string, If set, then only the Routines matching this filter are returned.
476The current supported form is either "routine_type:&lt;RoutineType&gt;" or
477"routineType:&lt;RoutineType&gt;", where &lt;RoutineType&gt; is a RoutineType enum.
478Example: "routineType:SCALAR_FUNCTION".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700479 pageToken: string, Page token, returned by a previous call, to request the next page of
480results
Dan O'Mearadd494642020-05-01 07:42:23 -0700481 maxResults: integer, The maximum number of results to return in a single response page.
482Leverage the page tokens to iterate through the entire collection.
483 readMask: string, If set, then only the Routine fields in the field mask, as well as
484project_id, dataset_id and routine_id, are returned in the response.
485If unset, then the following Routine fields are returned:
486etag, project_id, dataset_id, routine_id, routine_type, creation_time,
487last_modified_time, and language.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700488
489Returns:
490 An object of the form:
491
492 {
493 "nextPageToken": "A String", # A token to request the next page of results.
Dan O'Mearadd494642020-05-01 07:42:23 -0700494 "routines": [ # Routines in the requested dataset. Unless read_mask is set in the request,
495 # only the following fields are populated:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700496 # etag, project_id, dataset_id, routine_id, routine_type, creation_time,
Dan O'Mearadd494642020-05-01 07:42:23 -0700497 # last_modified_time, and language.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700498 { # A user-defined function or a stored procedure.
Dan O'Mearadd494642020-05-01 07:42:23 -0700499 "routineType": "A String", # Required. The type of routine.
500 "description": "A String", # Optional. [Experimental] The description of the routine if defined.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700501 "language": "A String", # Optional. Defaults to "SQL".
502 "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since
503 # the epoch.
504 "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the
505 # imported JAVASCRIPT libraries.
506 "A String",
507 ],
508 "routineReference": { # Required. Reference describing the ID of this routine.
509 "projectId": "A String", # [Required] The ID of the project containing this routine.
510 "routineId": "A String", # [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters.
511 "datasetId": "A String", # [Required] The ID of the dataset containing this routine.
512 },
513 "etag": "A String", # Output only. A hash of this resource.
514 "arguments": [ # Optional.
515 { # Input/output argument of a function or a stored procedure.
516 "dataType": { # The type of a variable, e.g., a function argument. # Required unless argument_kind = ANY_TYPE.
517 # Examples:
518 # INT64: {type_kind="INT64"}
Dan O'Mearadd494642020-05-01 07:42:23 -0700519 # ARRAY&lt;STRING&gt;: {type_kind="ARRAY", array_element_type="STRING"}
520 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700521 # {type_kind="STRUCT",
522 # struct_type={fields=[
523 # {name="x", type={type_kind="STRING"}},
524 # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}}
525 # ]}}
526 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT".
527 "fields": [
528 # Object with schema name: StandardSqlField
529 ],
530 },
531 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY".
532 "typeKind": "A String", # Required. The top level type of this field.
533 # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
534 },
535 "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE.
Dan O'Mearadd494642020-05-01 07:42:23 -0700536 "name": "A String", # Optional. The name of this argument. Can be absent for function return argument.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700537 "mode": "A String", # Optional. Specifies whether the argument is input or output.
538 # Can be set for procedures only.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700539 },
540 ],
541 "returnType": { # The type of a variable, e.g., a function argument. # Optional if language = "SQL"; required otherwise.
Dan O'Mearadd494642020-05-01 07:42:23 -0700542 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700543 # If absent, the return type is inferred from definition_body at query time
544 # in each query that references this routine. If present, then the evaluated
545 # result will be cast to the specified returned type at query time.
546 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700547 # For example, for the functions created with the following statements:
548 #
549 # * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);`
550 #
551 # * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));`
552 #
553 # * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));`
554 #
555 # The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and
556 # is absent for `Increment` (inferred as FLOAT64 at query time).
557 #
558 # Suppose the function `Add` is replaced by
559 # `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);`
560 #
561 # Then the inferred return type of `Increment` is automatically changed to
562 # INT64 at query time, while the return type of `Decrement` remains FLOAT64.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700563 # Examples:
564 # INT64: {type_kind="INT64"}
Dan O'Mearadd494642020-05-01 07:42:23 -0700565 # ARRAY&lt;STRING&gt;: {type_kind="ARRAY", array_element_type="STRING"}
566 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700567 # {type_kind="STRUCT",
568 # struct_type={fields=[
569 # {name="x", type={type_kind="STRING"}},
570 # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}}
571 # ]}}
572 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT".
573 "fields": [
574 # Object with schema name: StandardSqlField
575 ],
576 },
577 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY".
578 "typeKind": "A String", # Required. The top level type of this field.
579 # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
580 },
581 "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds
582 # since the epoch.
583 "definitionBody": "A String", # Required. The body of the routine.
Dan O'Mearadd494642020-05-01 07:42:23 -0700584 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700585 # For functions, this is the expression in the AS clause.
Dan O'Mearadd494642020-05-01 07:42:23 -0700586 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700587 # If language=SQL, it is the substring inside (but excluding) the
588 # parentheses. For example, for the function created with the following
Dan O'Mearadd494642020-05-01 07:42:23 -0700589 # statement:
590 #
591 # `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))`
592 #
593 # The definition_body is `concat(x, "\n", y)` (\n is not replaced with
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700594 # linebreak).
Dan O'Mearadd494642020-05-01 07:42:23 -0700595 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700596 # If language=JAVASCRIPT, it is the evaluated string in the AS clause.
Dan O'Mearadd494642020-05-01 07:42:23 -0700597 # For example, for the function created with the following statement:
598 #
599 # `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'`
600 #
601 # The definition_body is
602 #
603 # `return "\n";\n`
604 #
605 # Note that both \n are replaced with linebreaks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700606 },
607 ],
608 }</pre>
609</div>
610
611<div class="method">
612 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
613 <pre>Retrieves the next page of results.
614
615Args:
616 previous_request: The request for the previous page. (required)
617 previous_response: The response from the request for the previous page. (required)
618
619Returns:
620 A request object that you can call 'execute()' on to request the next
621 page. Returns None if there are no more items in the collection.
622 </pre>
623</div>
624
625<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700626 <code class="details" id="update">update(projectId, datasetId, routineId, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700627 <pre>Updates information in an existing routine. The update method replaces the
628entire Routine resource.
629
630Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700631 projectId: string, Required. Project ID of the routine to update (required)
632 datasetId: string, Required. Dataset ID of the routine to update (required)
633 routineId: string, Required. Routine ID of the routine to update (required)
634 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700635 The object takes the form of:
636
637{ # A user-defined function or a stored procedure.
Dan O'Mearadd494642020-05-01 07:42:23 -0700638 "routineType": "A String", # Required. The type of routine.
639 "description": "A String", # Optional. [Experimental] The description of the routine if defined.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700640 "language": "A String", # Optional. Defaults to "SQL".
641 "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since
642 # the epoch.
643 "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the
644 # imported JAVASCRIPT libraries.
645 "A String",
646 ],
647 "routineReference": { # Required. Reference describing the ID of this routine.
648 "projectId": "A String", # [Required] The ID of the project containing this routine.
649 "routineId": "A String", # [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters.
650 "datasetId": "A String", # [Required] The ID of the dataset containing this routine.
651 },
652 "etag": "A String", # Output only. A hash of this resource.
653 "arguments": [ # Optional.
654 { # Input/output argument of a function or a stored procedure.
655 "dataType": { # The type of a variable, e.g., a function argument. # Required unless argument_kind = ANY_TYPE.
656 # Examples:
657 # INT64: {type_kind="INT64"}
Dan O'Mearadd494642020-05-01 07:42:23 -0700658 # ARRAY&lt;STRING&gt;: {type_kind="ARRAY", array_element_type="STRING"}
659 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700660 # {type_kind="STRUCT",
661 # struct_type={fields=[
662 # {name="x", type={type_kind="STRING"}},
663 # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}}
664 # ]}}
665 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT".
666 "fields": [
667 # Object with schema name: StandardSqlField
668 ],
669 },
670 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY".
671 "typeKind": "A String", # Required. The top level type of this field.
672 # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
673 },
674 "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE.
Dan O'Mearadd494642020-05-01 07:42:23 -0700675 "name": "A String", # Optional. The name of this argument. Can be absent for function return argument.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700676 "mode": "A String", # Optional. Specifies whether the argument is input or output.
677 # Can be set for procedures only.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700678 },
679 ],
680 "returnType": { # The type of a variable, e.g., a function argument. # Optional if language = "SQL"; required otherwise.
Dan O'Mearadd494642020-05-01 07:42:23 -0700681 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700682 # If absent, the return type is inferred from definition_body at query time
683 # in each query that references this routine. If present, then the evaluated
684 # result will be cast to the specified returned type at query time.
685 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700686 # For example, for the functions created with the following statements:
687 #
688 # * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);`
689 #
690 # * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));`
691 #
692 # * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));`
693 #
694 # The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and
695 # is absent for `Increment` (inferred as FLOAT64 at query time).
696 #
697 # Suppose the function `Add` is replaced by
698 # `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);`
699 #
700 # Then the inferred return type of `Increment` is automatically changed to
701 # INT64 at query time, while the return type of `Decrement` remains FLOAT64.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700702 # Examples:
703 # INT64: {type_kind="INT64"}
Dan O'Mearadd494642020-05-01 07:42:23 -0700704 # ARRAY&lt;STRING&gt;: {type_kind="ARRAY", array_element_type="STRING"}
705 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700706 # {type_kind="STRUCT",
707 # struct_type={fields=[
708 # {name="x", type={type_kind="STRING"}},
709 # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}}
710 # ]}}
711 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT".
712 "fields": [
713 # Object with schema name: StandardSqlField
714 ],
715 },
716 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY".
717 "typeKind": "A String", # Required. The top level type of this field.
718 # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
719 },
720 "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds
721 # since the epoch.
722 "definitionBody": "A String", # Required. The body of the routine.
Dan O'Mearadd494642020-05-01 07:42:23 -0700723 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700724 # For functions, this is the expression in the AS clause.
Dan O'Mearadd494642020-05-01 07:42:23 -0700725 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700726 # If language=SQL, it is the substring inside (but excluding) the
727 # parentheses. For example, for the function created with the following
Dan O'Mearadd494642020-05-01 07:42:23 -0700728 # statement:
729 #
730 # `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))`
731 #
732 # The definition_body is `concat(x, "\n", y)` (\n is not replaced with
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700733 # linebreak).
Dan O'Mearadd494642020-05-01 07:42:23 -0700734 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700735 # If language=JAVASCRIPT, it is the evaluated string in the AS clause.
Dan O'Mearadd494642020-05-01 07:42:23 -0700736 # For example, for the function created with the following statement:
737 #
738 # `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'`
739 #
740 # The definition_body is
741 #
742 # `return "\n";\n`
743 #
744 # Note that both \n are replaced with linebreaks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700745 }
746
747
748Returns:
749 An object of the form:
750
751 { # A user-defined function or a stored procedure.
Dan O'Mearadd494642020-05-01 07:42:23 -0700752 "routineType": "A String", # Required. The type of routine.
753 "description": "A String", # Optional. [Experimental] The description of the routine if defined.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700754 "language": "A String", # Optional. Defaults to "SQL".
755 "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since
756 # the epoch.
757 "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the
758 # imported JAVASCRIPT libraries.
759 "A String",
760 ],
761 "routineReference": { # Required. Reference describing the ID of this routine.
762 "projectId": "A String", # [Required] The ID of the project containing this routine.
763 "routineId": "A String", # [Required] The ID of the routine. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 256 characters.
764 "datasetId": "A String", # [Required] The ID of the dataset containing this routine.
765 },
766 "etag": "A String", # Output only. A hash of this resource.
767 "arguments": [ # Optional.
768 { # Input/output argument of a function or a stored procedure.
769 "dataType": { # The type of a variable, e.g., a function argument. # Required unless argument_kind = ANY_TYPE.
770 # Examples:
771 # INT64: {type_kind="INT64"}
Dan O'Mearadd494642020-05-01 07:42:23 -0700772 # ARRAY&lt;STRING&gt;: {type_kind="ARRAY", array_element_type="STRING"}
773 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700774 # {type_kind="STRUCT",
775 # struct_type={fields=[
776 # {name="x", type={type_kind="STRING"}},
777 # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}}
778 # ]}}
779 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT".
780 "fields": [
781 # Object with schema name: StandardSqlField
782 ],
783 },
784 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY".
785 "typeKind": "A String", # Required. The top level type of this field.
786 # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
787 },
788 "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE.
Dan O'Mearadd494642020-05-01 07:42:23 -0700789 "name": "A String", # Optional. The name of this argument. Can be absent for function return argument.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700790 "mode": "A String", # Optional. Specifies whether the argument is input or output.
791 # Can be set for procedures only.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700792 },
793 ],
794 "returnType": { # The type of a variable, e.g., a function argument. # Optional if language = "SQL"; required otherwise.
Dan O'Mearadd494642020-05-01 07:42:23 -0700795 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700796 # If absent, the return type is inferred from definition_body at query time
797 # in each query that references this routine. If present, then the evaluated
798 # result will be cast to the specified returned type at query time.
799 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700800 # For example, for the functions created with the following statements:
801 #
802 # * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);`
803 #
804 # * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));`
805 #
806 # * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));`
807 #
808 # The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and
809 # is absent for `Increment` (inferred as FLOAT64 at query time).
810 #
811 # Suppose the function `Add` is replaced by
812 # `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);`
813 #
814 # Then the inferred return type of `Increment` is automatically changed to
815 # INT64 at query time, while the return type of `Decrement` remains FLOAT64.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700816 # Examples:
817 # INT64: {type_kind="INT64"}
Dan O'Mearadd494642020-05-01 07:42:23 -0700818 # ARRAY&lt;STRING&gt;: {type_kind="ARRAY", array_element_type="STRING"}
819 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700820 # {type_kind="STRUCT",
821 # struct_type={fields=[
822 # {name="x", type={type_kind="STRING"}},
823 # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}}
824 # ]}}
825 "structType": { # The fields of this struct, in order, if type_kind = "STRUCT".
826 "fields": [
827 # Object with schema name: StandardSqlField
828 ],
829 },
830 "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY".
831 "typeKind": "A String", # Required. The top level type of this field.
832 # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY").
833 },
834 "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds
835 # since the epoch.
836 "definitionBody": "A String", # Required. The body of the routine.
Dan O'Mearadd494642020-05-01 07:42:23 -0700837 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700838 # For functions, this is the expression in the AS clause.
Dan O'Mearadd494642020-05-01 07:42:23 -0700839 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700840 # If language=SQL, it is the substring inside (but excluding) the
841 # parentheses. For example, for the function created with the following
Dan O'Mearadd494642020-05-01 07:42:23 -0700842 # statement:
843 #
844 # `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))`
845 #
846 # The definition_body is `concat(x, "\n", y)` (\n is not replaced with
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700847 # linebreak).
Dan O'Mearadd494642020-05-01 07:42:23 -0700848 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700849 # If language=JAVASCRIPT, it is the evaluated string in the AS clause.
Dan O'Mearadd494642020-05-01 07:42:23 -0700850 # For example, for the function created with the following statement:
851 #
852 # `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'`
853 #
854 # The definition_body is
855 #
856 # `return "\n";\n`
857 #
858 # Note that both \n are replaced with linebreaks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700859 }</pre>
860</div>
861
862</body></html>