Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 81 | <code><a href="#get">get(projectId, datasetId, routineId, readMask=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 82 | <p class="firstline">Gets the specified routine resource by routine ID.</p> |
| 83 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 84 | <code><a href="#insert">insert(projectId, datasetId, body=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 85 | <p class="firstline">Creates a new routine in the dataset.</p> |
| 86 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 87 | <code><a href="#list">list(projectId, datasetId, readMask=None, filter=None, pageToken=None, maxResults=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 88 | <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'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 93 | <code><a href="#update">update(projectId, datasetId, routineId, body=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 94 | <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 | |
| 100 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 101 | 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 Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 104 | </pre> |
| 105 | </div> |
| 106 | |
| 107 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 108 | <code class="details" id="get">get(projectId, datasetId, routineId, readMask=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 109 | <pre>Gets the specified routine resource by routine ID. |
| 110 | |
| 111 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 112 | 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 Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 116 | response. If unset, all Routine fields are returned. |
| 117 | |
| 118 | Returns: |
| 119 | An object of the form: |
| 120 | |
| 121 | { # A user-defined function or a stored procedure. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 122 | "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 123 | # imported JAVASCRIPT libraries. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 124 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 125 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 126 | "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds |
| 127 | # since the epoch. |
| 128 | "returnType": { # The type of a variable, e.g., a function argument. # Optional if language = "SQL"; required otherwise. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 129 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 130 | # If absent, the return type is inferred from definition_body at query time |
| 131 | # in each query that references this routine. If present, then the evaluated |
| 132 | # result will be cast to the specified returned type at query time. |
| 133 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 134 | # For example, for the functions created with the following statements: |
| 135 | # |
| 136 | # * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` |
| 137 | # |
| 138 | # * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` |
| 139 | # |
| 140 | # * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` |
| 141 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 142 | # The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 143 | # is absent for `Increment` (inferred as FLOAT64 at query time). |
| 144 | # |
| 145 | # Suppose the function `Add` is replaced by |
| 146 | # `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` |
| 147 | # |
| 148 | # Then the inferred return type of `Increment` is automatically changed to |
| 149 | # INT64 at query time, while the return type of `Decrement` remains FLOAT64. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 150 | # Examples: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 151 | # INT64: {type_kind="INT64"} |
| 152 | # ARRAY<STRING>: {type_kind="ARRAY", array_element_type="STRING"} |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 153 | # STRUCT<x STRING, y ARRAY<DATE>>: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 154 | # {type_kind="STRUCT", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 155 | # struct_type={fields=[ |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 156 | # {name="x", type={type_kind="STRING"}}, |
| 157 | # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 158 | # ]}} |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 159 | "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". |
| 160 | "fields": [ |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 161 | # Object with schema name: StandardSqlField |
| 162 | ], |
| 163 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 164 | "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". |
| 165 | "typeKind": "A String", # Required. The top level type of this field. |
| 166 | # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 167 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 168 | "language": "A String", # Optional. Defaults to "SQL". |
| 169 | "description": "A String", # Optional. [Experimental] The description of the routine if defined. |
| 170 | "etag": "A String", # Output only. A hash of this resource. |
| 171 | "definitionBody": "A String", # Required. The body of the routine. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 172 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 173 | # For functions, this is the expression in the AS clause. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 174 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 175 | # If language=SQL, it is the substring inside (but excluding) the |
| 176 | # parentheses. For example, for the function created with the following |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 177 | # statement: |
| 178 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 179 | # `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 180 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 181 | # The definition_body is `concat(x, "\n", y)` (\n is not replaced with |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 182 | # linebreak). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 183 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 184 | # If language=JAVASCRIPT, it is the evaluated string in the AS clause. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 185 | # For example, for the function created with the following statement: |
| 186 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 187 | # `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 188 | # |
| 189 | # The definition_body is |
| 190 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 191 | # `return "\n";\n` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 192 | # |
| 193 | # Note that both \n are replaced with linebreaks. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 194 | "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since |
| 195 | # the epoch. |
| 196 | "routineType": "A String", # Required. The type of routine. |
| 197 | "routineReference": { # Required. Reference describing the ID of this routine. |
| 198 | "projectId": "A String", # [Required] The ID of the project containing this routine. |
| 199 | "datasetId": "A String", # [Required] The ID of the dataset containing this routine. |
| 200 | "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. |
| 201 | }, |
| 202 | "arguments": [ # Optional. |
| 203 | { # Input/output argument of a function or a stored procedure. |
| 204 | "name": "A String", # Optional. The name of this argument. Can be absent for function return argument. |
| 205 | "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE. |
| 206 | "mode": "A String", # Optional. Specifies whether the argument is input or output. |
| 207 | # Can be set for procedures only. |
| 208 | "dataType": { # The type of a variable, e.g., a function argument. # Required unless argument_kind = ANY_TYPE. |
| 209 | # Examples: |
| 210 | # INT64: {type_kind="INT64"} |
| 211 | # ARRAY<STRING>: {type_kind="ARRAY", array_element_type="STRING"} |
| 212 | # STRUCT<x STRING, y ARRAY<DATE>>: |
| 213 | # {type_kind="STRUCT", |
| 214 | # struct_type={fields=[ |
| 215 | # {name="x", type={type_kind="STRING"}}, |
| 216 | # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} |
| 217 | # ]}} |
| 218 | "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". |
| 219 | "fields": [ |
| 220 | # Object with schema name: StandardSqlField |
| 221 | ], |
| 222 | }, |
| 223 | "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". |
| 224 | "typeKind": "A String", # Required. The top level type of this field. |
| 225 | # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). |
| 226 | }, |
| 227 | }, |
| 228 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 229 | }</pre> |
| 230 | </div> |
| 231 | |
| 232 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 233 | <code class="details" id="insert">insert(projectId, datasetId, body=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 234 | <pre>Creates a new routine in the dataset. |
| 235 | |
| 236 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 237 | 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 Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 240 | The object takes the form of: |
| 241 | |
| 242 | { # A user-defined function or a stored procedure. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 243 | "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 244 | # imported JAVASCRIPT libraries. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 245 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 246 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 247 | "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds |
| 248 | # since the epoch. |
| 249 | "returnType": { # The type of a variable, e.g., a function argument. # Optional if language = "SQL"; required otherwise. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 250 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 251 | # If absent, the return type is inferred from definition_body at query time |
| 252 | # in each query that references this routine. If present, then the evaluated |
| 253 | # result will be cast to the specified returned type at query time. |
| 254 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 255 | # For example, for the functions created with the following statements: |
| 256 | # |
| 257 | # * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` |
| 258 | # |
| 259 | # * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` |
| 260 | # |
| 261 | # * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` |
| 262 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 263 | # The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 264 | # is absent for `Increment` (inferred as FLOAT64 at query time). |
| 265 | # |
| 266 | # Suppose the function `Add` is replaced by |
| 267 | # `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` |
| 268 | # |
| 269 | # Then the inferred return type of `Increment` is automatically changed to |
| 270 | # INT64 at query time, while the return type of `Decrement` remains FLOAT64. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 271 | # Examples: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 272 | # INT64: {type_kind="INT64"} |
| 273 | # ARRAY<STRING>: {type_kind="ARRAY", array_element_type="STRING"} |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 274 | # STRUCT<x STRING, y ARRAY<DATE>>: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 275 | # {type_kind="STRUCT", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 276 | # struct_type={fields=[ |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 277 | # {name="x", type={type_kind="STRING"}}, |
| 278 | # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 279 | # ]}} |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 280 | "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". |
| 281 | "fields": [ |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 282 | # Object with schema name: StandardSqlField |
| 283 | ], |
| 284 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 285 | "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". |
| 286 | "typeKind": "A String", # Required. The top level type of this field. |
| 287 | # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 288 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 289 | "language": "A String", # Optional. Defaults to "SQL". |
| 290 | "description": "A String", # Optional. [Experimental] The description of the routine if defined. |
| 291 | "etag": "A String", # Output only. A hash of this resource. |
| 292 | "definitionBody": "A String", # Required. The body of the routine. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 293 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 294 | # For functions, this is the expression in the AS clause. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 295 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 296 | # If language=SQL, it is the substring inside (but excluding) the |
| 297 | # parentheses. For example, for the function created with the following |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 298 | # statement: |
| 299 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 300 | # `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 301 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 302 | # The definition_body is `concat(x, "\n", y)` (\n is not replaced with |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 303 | # linebreak). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 304 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 305 | # If language=JAVASCRIPT, it is the evaluated string in the AS clause. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 306 | # For example, for the function created with the following statement: |
| 307 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 308 | # `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 309 | # |
| 310 | # The definition_body is |
| 311 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 312 | # `return "\n";\n` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 313 | # |
| 314 | # Note that both \n are replaced with linebreaks. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 315 | "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since |
| 316 | # the epoch. |
| 317 | "routineType": "A String", # Required. The type of routine. |
| 318 | "routineReference": { # Required. Reference describing the ID of this routine. |
| 319 | "projectId": "A String", # [Required] The ID of the project containing this routine. |
| 320 | "datasetId": "A String", # [Required] The ID of the dataset containing this routine. |
| 321 | "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. |
| 322 | }, |
| 323 | "arguments": [ # Optional. |
| 324 | { # Input/output argument of a function or a stored procedure. |
| 325 | "name": "A String", # Optional. The name of this argument. Can be absent for function return argument. |
| 326 | "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE. |
| 327 | "mode": "A String", # Optional. Specifies whether the argument is input or output. |
| 328 | # Can be set for procedures only. |
| 329 | "dataType": { # The type of a variable, e.g., a function argument. # Required unless argument_kind = ANY_TYPE. |
| 330 | # Examples: |
| 331 | # INT64: {type_kind="INT64"} |
| 332 | # ARRAY<STRING>: {type_kind="ARRAY", array_element_type="STRING"} |
| 333 | # STRUCT<x STRING, y ARRAY<DATE>>: |
| 334 | # {type_kind="STRUCT", |
| 335 | # struct_type={fields=[ |
| 336 | # {name="x", type={type_kind="STRING"}}, |
| 337 | # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} |
| 338 | # ]}} |
| 339 | "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". |
| 340 | "fields": [ |
| 341 | # Object with schema name: StandardSqlField |
| 342 | ], |
| 343 | }, |
| 344 | "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". |
| 345 | "typeKind": "A String", # Required. The top level type of this field. |
| 346 | # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). |
| 347 | }, |
| 348 | }, |
| 349 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | |
| 353 | Returns: |
| 354 | An object of the form: |
| 355 | |
| 356 | { # A user-defined function or a stored procedure. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 357 | "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 358 | # imported JAVASCRIPT libraries. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 359 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 360 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 361 | "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds |
| 362 | # since the epoch. |
| 363 | "returnType": { # The type of a variable, e.g., a function argument. # Optional if language = "SQL"; required otherwise. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 364 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 365 | # If absent, the return type is inferred from definition_body at query time |
| 366 | # in each query that references this routine. If present, then the evaluated |
| 367 | # result will be cast to the specified returned type at query time. |
| 368 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 369 | # For example, for the functions created with the following statements: |
| 370 | # |
| 371 | # * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` |
| 372 | # |
| 373 | # * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` |
| 374 | # |
| 375 | # * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` |
| 376 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 377 | # The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 378 | # is absent for `Increment` (inferred as FLOAT64 at query time). |
| 379 | # |
| 380 | # Suppose the function `Add` is replaced by |
| 381 | # `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` |
| 382 | # |
| 383 | # Then the inferred return type of `Increment` is automatically changed to |
| 384 | # INT64 at query time, while the return type of `Decrement` remains FLOAT64. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 385 | # Examples: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 386 | # INT64: {type_kind="INT64"} |
| 387 | # ARRAY<STRING>: {type_kind="ARRAY", array_element_type="STRING"} |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 388 | # STRUCT<x STRING, y ARRAY<DATE>>: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 389 | # {type_kind="STRUCT", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 390 | # struct_type={fields=[ |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 391 | # {name="x", type={type_kind="STRING"}}, |
| 392 | # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 393 | # ]}} |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 394 | "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". |
| 395 | "fields": [ |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 396 | # Object with schema name: StandardSqlField |
| 397 | ], |
| 398 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 399 | "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". |
| 400 | "typeKind": "A String", # Required. The top level type of this field. |
| 401 | # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 402 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 403 | "language": "A String", # Optional. Defaults to "SQL". |
| 404 | "description": "A String", # Optional. [Experimental] The description of the routine if defined. |
| 405 | "etag": "A String", # Output only. A hash of this resource. |
| 406 | "definitionBody": "A String", # Required. The body of the routine. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 407 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 408 | # For functions, this is the expression in the AS clause. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 409 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 410 | # If language=SQL, it is the substring inside (but excluding) the |
| 411 | # parentheses. For example, for the function created with the following |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 412 | # statement: |
| 413 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 414 | # `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 415 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 416 | # The definition_body is `concat(x, "\n", y)` (\n is not replaced with |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 417 | # linebreak). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 418 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 419 | # If language=JAVASCRIPT, it is the evaluated string in the AS clause. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 420 | # For example, for the function created with the following statement: |
| 421 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 422 | # `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 423 | # |
| 424 | # The definition_body is |
| 425 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 426 | # `return "\n";\n` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 427 | # |
| 428 | # Note that both \n are replaced with linebreaks. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 429 | "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since |
| 430 | # the epoch. |
| 431 | "routineType": "A String", # Required. The type of routine. |
| 432 | "routineReference": { # Required. Reference describing the ID of this routine. |
| 433 | "projectId": "A String", # [Required] The ID of the project containing this routine. |
| 434 | "datasetId": "A String", # [Required] The ID of the dataset containing this routine. |
| 435 | "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. |
| 436 | }, |
| 437 | "arguments": [ # Optional. |
| 438 | { # Input/output argument of a function or a stored procedure. |
| 439 | "name": "A String", # Optional. The name of this argument. Can be absent for function return argument. |
| 440 | "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE. |
| 441 | "mode": "A String", # Optional. Specifies whether the argument is input or output. |
| 442 | # Can be set for procedures only. |
| 443 | "dataType": { # The type of a variable, e.g., a function argument. # Required unless argument_kind = ANY_TYPE. |
| 444 | # Examples: |
| 445 | # INT64: {type_kind="INT64"} |
| 446 | # ARRAY<STRING>: {type_kind="ARRAY", array_element_type="STRING"} |
| 447 | # STRUCT<x STRING, y ARRAY<DATE>>: |
| 448 | # {type_kind="STRUCT", |
| 449 | # struct_type={fields=[ |
| 450 | # {name="x", type={type_kind="STRING"}}, |
| 451 | # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} |
| 452 | # ]}} |
| 453 | "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". |
| 454 | "fields": [ |
| 455 | # Object with schema name: StandardSqlField |
| 456 | ], |
| 457 | }, |
| 458 | "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". |
| 459 | "typeKind": "A String", # Required. The top level type of this field. |
| 460 | # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). |
| 461 | }, |
| 462 | }, |
| 463 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 464 | }</pre> |
| 465 | </div> |
| 466 | |
| 467 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 468 | <code class="details" id="list">list(projectId, datasetId, readMask=None, filter=None, pageToken=None, maxResults=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 469 | <pre>Lists all routines in the specified dataset. Requires the READER dataset |
| 470 | role. |
| 471 | |
| 472 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 473 | projectId: string, Required. Project ID of the routines to list (required) |
| 474 | datasetId: string, Required. Dataset ID of the routines to list (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 475 | readMask: string, If set, then only the Routine fields in the field mask, as well as |
| 476 | project_id, dataset_id and routine_id, are returned in the response. |
| 477 | If unset, then the following Routine fields are returned: |
| 478 | etag, project_id, dataset_id, routine_id, routine_type, creation_time, |
| 479 | last_modified_time, and language. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 480 | filter: string, If set, then only the Routines matching this filter are returned. |
| 481 | The current supported form is either "routine_type:<RoutineType>" or |
| 482 | "routineType:<RoutineType>", where <RoutineType> is a RoutineType enum. |
| 483 | Example: "routineType:SCALAR_FUNCTION". |
| 484 | pageToken: string, Page token, returned by a previous call, to request the next page of |
| 485 | results |
| 486 | maxResults: integer, The maximum number of results to return in a single response page. |
| 487 | Leverage the page tokens to iterate through the entire collection. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 488 | |
| 489 | Returns: |
| 490 | An object of the form: |
| 491 | |
| 492 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 493 | "routines": [ # Routines in the requested dataset. Unless read_mask is set in the request, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 494 | # only the following fields are populated: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 495 | # etag, project_id, dataset_id, routine_id, routine_type, creation_time, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 496 | # last_modified_time, and language. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 497 | { # A user-defined function or a stored procedure. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 498 | "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 499 | # imported JAVASCRIPT libraries. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 500 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 501 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 502 | "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds |
| 503 | # since the epoch. |
| 504 | "returnType": { # The type of a variable, e.g., a function argument. # Optional if language = "SQL"; required otherwise. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 505 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 506 | # If absent, the return type is inferred from definition_body at query time |
| 507 | # in each query that references this routine. If present, then the evaluated |
| 508 | # result will be cast to the specified returned type at query time. |
| 509 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 510 | # For example, for the functions created with the following statements: |
| 511 | # |
| 512 | # * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` |
| 513 | # |
| 514 | # * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` |
| 515 | # |
| 516 | # * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` |
| 517 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 518 | # The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 519 | # is absent for `Increment` (inferred as FLOAT64 at query time). |
| 520 | # |
| 521 | # Suppose the function `Add` is replaced by |
| 522 | # `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` |
| 523 | # |
| 524 | # Then the inferred return type of `Increment` is automatically changed to |
| 525 | # INT64 at query time, while the return type of `Decrement` remains FLOAT64. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 526 | # Examples: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 527 | # INT64: {type_kind="INT64"} |
| 528 | # ARRAY<STRING>: {type_kind="ARRAY", array_element_type="STRING"} |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 529 | # STRUCT<x STRING, y ARRAY<DATE>>: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 530 | # {type_kind="STRUCT", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 531 | # struct_type={fields=[ |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 532 | # {name="x", type={type_kind="STRING"}}, |
| 533 | # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 534 | # ]}} |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 535 | "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". |
| 536 | "fields": [ |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 537 | # Object with schema name: StandardSqlField |
| 538 | ], |
| 539 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 540 | "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". |
| 541 | "typeKind": "A String", # Required. The top level type of this field. |
| 542 | # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 543 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 544 | "language": "A String", # Optional. Defaults to "SQL". |
| 545 | "description": "A String", # Optional. [Experimental] The description of the routine if defined. |
| 546 | "etag": "A String", # Output only. A hash of this resource. |
| 547 | "definitionBody": "A String", # Required. The body of the routine. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 548 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 549 | # For functions, this is the expression in the AS clause. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 550 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 551 | # If language=SQL, it is the substring inside (but excluding) the |
| 552 | # parentheses. For example, for the function created with the following |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 553 | # statement: |
| 554 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 555 | # `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 556 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 557 | # The definition_body is `concat(x, "\n", y)` (\n is not replaced with |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 558 | # linebreak). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 559 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 560 | # If language=JAVASCRIPT, it is the evaluated string in the AS clause. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 561 | # For example, for the function created with the following statement: |
| 562 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 563 | # `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 564 | # |
| 565 | # The definition_body is |
| 566 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 567 | # `return "\n";\n` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 568 | # |
| 569 | # Note that both \n are replaced with linebreaks. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 570 | "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since |
| 571 | # the epoch. |
| 572 | "routineType": "A String", # Required. The type of routine. |
| 573 | "routineReference": { # Required. Reference describing the ID of this routine. |
| 574 | "projectId": "A String", # [Required] The ID of the project containing this routine. |
| 575 | "datasetId": "A String", # [Required] The ID of the dataset containing this routine. |
| 576 | "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. |
| 577 | }, |
| 578 | "arguments": [ # Optional. |
| 579 | { # Input/output argument of a function or a stored procedure. |
| 580 | "name": "A String", # Optional. The name of this argument. Can be absent for function return argument. |
| 581 | "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE. |
| 582 | "mode": "A String", # Optional. Specifies whether the argument is input or output. |
| 583 | # Can be set for procedures only. |
| 584 | "dataType": { # The type of a variable, e.g., a function argument. # Required unless argument_kind = ANY_TYPE. |
| 585 | # Examples: |
| 586 | # INT64: {type_kind="INT64"} |
| 587 | # ARRAY<STRING>: {type_kind="ARRAY", array_element_type="STRING"} |
| 588 | # STRUCT<x STRING, y ARRAY<DATE>>: |
| 589 | # {type_kind="STRUCT", |
| 590 | # struct_type={fields=[ |
| 591 | # {name="x", type={type_kind="STRING"}}, |
| 592 | # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} |
| 593 | # ]}} |
| 594 | "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". |
| 595 | "fields": [ |
| 596 | # Object with schema name: StandardSqlField |
| 597 | ], |
| 598 | }, |
| 599 | "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". |
| 600 | "typeKind": "A String", # Required. The top level type of this field. |
| 601 | # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). |
| 602 | }, |
| 603 | }, |
| 604 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 605 | }, |
| 606 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 607 | "nextPageToken": "A String", # A token to request the next page of results. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 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 | |
| 615 | Args: |
| 616 | previous_request: The request for the previous page. (required) |
| 617 | previous_response: The response from the request for the previous page. (required) |
| 618 | |
| 619 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 620 | A request object that you can call 'execute()' on to request the next |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 621 | page. Returns None if there are no more items in the collection. |
| 622 | </pre> |
| 623 | </div> |
| 624 | |
| 625 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 626 | <code class="details" id="update">update(projectId, datasetId, routineId, body=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 627 | <pre>Updates information in an existing routine. The update method replaces the |
| 628 | entire Routine resource. |
| 629 | |
| 630 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 631 | 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 Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 635 | The object takes the form of: |
| 636 | |
| 637 | { # A user-defined function or a stored procedure. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 638 | "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 639 | # imported JAVASCRIPT libraries. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 640 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 641 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 642 | "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds |
| 643 | # since the epoch. |
| 644 | "returnType": { # The type of a variable, e.g., a function argument. # Optional if language = "SQL"; required otherwise. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 645 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 646 | # If absent, the return type is inferred from definition_body at query time |
| 647 | # in each query that references this routine. If present, then the evaluated |
| 648 | # result will be cast to the specified returned type at query time. |
| 649 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 650 | # For example, for the functions created with the following statements: |
| 651 | # |
| 652 | # * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` |
| 653 | # |
| 654 | # * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` |
| 655 | # |
| 656 | # * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` |
| 657 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 658 | # The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 659 | # is absent for `Increment` (inferred as FLOAT64 at query time). |
| 660 | # |
| 661 | # Suppose the function `Add` is replaced by |
| 662 | # `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` |
| 663 | # |
| 664 | # Then the inferred return type of `Increment` is automatically changed to |
| 665 | # INT64 at query time, while the return type of `Decrement` remains FLOAT64. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 666 | # Examples: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 667 | # INT64: {type_kind="INT64"} |
| 668 | # ARRAY<STRING>: {type_kind="ARRAY", array_element_type="STRING"} |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 669 | # STRUCT<x STRING, y ARRAY<DATE>>: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 670 | # {type_kind="STRUCT", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 671 | # struct_type={fields=[ |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 672 | # {name="x", type={type_kind="STRING"}}, |
| 673 | # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 674 | # ]}} |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 675 | "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". |
| 676 | "fields": [ |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 677 | # Object with schema name: StandardSqlField |
| 678 | ], |
| 679 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 680 | "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". |
| 681 | "typeKind": "A String", # Required. The top level type of this field. |
| 682 | # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 683 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 684 | "language": "A String", # Optional. Defaults to "SQL". |
| 685 | "description": "A String", # Optional. [Experimental] The description of the routine if defined. |
| 686 | "etag": "A String", # Output only. A hash of this resource. |
| 687 | "definitionBody": "A String", # Required. The body of the routine. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 688 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 689 | # For functions, this is the expression in the AS clause. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 690 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 691 | # If language=SQL, it is the substring inside (but excluding) the |
| 692 | # parentheses. For example, for the function created with the following |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 693 | # statement: |
| 694 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 695 | # `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 696 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 697 | # The definition_body is `concat(x, "\n", y)` (\n is not replaced with |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 698 | # linebreak). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 699 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 700 | # If language=JAVASCRIPT, it is the evaluated string in the AS clause. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 701 | # For example, for the function created with the following statement: |
| 702 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 703 | # `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 704 | # |
| 705 | # The definition_body is |
| 706 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 707 | # `return "\n";\n` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 708 | # |
| 709 | # Note that both \n are replaced with linebreaks. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 710 | "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since |
| 711 | # the epoch. |
| 712 | "routineType": "A String", # Required. The type of routine. |
| 713 | "routineReference": { # Required. Reference describing the ID of this routine. |
| 714 | "projectId": "A String", # [Required] The ID of the project containing this routine. |
| 715 | "datasetId": "A String", # [Required] The ID of the dataset containing this routine. |
| 716 | "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. |
| 717 | }, |
| 718 | "arguments": [ # Optional. |
| 719 | { # Input/output argument of a function or a stored procedure. |
| 720 | "name": "A String", # Optional. The name of this argument. Can be absent for function return argument. |
| 721 | "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE. |
| 722 | "mode": "A String", # Optional. Specifies whether the argument is input or output. |
| 723 | # Can be set for procedures only. |
| 724 | "dataType": { # The type of a variable, e.g., a function argument. # Required unless argument_kind = ANY_TYPE. |
| 725 | # Examples: |
| 726 | # INT64: {type_kind="INT64"} |
| 727 | # ARRAY<STRING>: {type_kind="ARRAY", array_element_type="STRING"} |
| 728 | # STRUCT<x STRING, y ARRAY<DATE>>: |
| 729 | # {type_kind="STRUCT", |
| 730 | # struct_type={fields=[ |
| 731 | # {name="x", type={type_kind="STRING"}}, |
| 732 | # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} |
| 733 | # ]}} |
| 734 | "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". |
| 735 | "fields": [ |
| 736 | # Object with schema name: StandardSqlField |
| 737 | ], |
| 738 | }, |
| 739 | "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". |
| 740 | "typeKind": "A String", # Required. The top level type of this field. |
| 741 | # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). |
| 742 | }, |
| 743 | }, |
| 744 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 745 | } |
| 746 | |
| 747 | |
| 748 | Returns: |
| 749 | An object of the form: |
| 750 | |
| 751 | { # A user-defined function or a stored procedure. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 752 | "importedLibraries": [ # Optional. If language = "JAVASCRIPT", this field stores the path of the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 753 | # imported JAVASCRIPT libraries. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 754 | "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 755 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 756 | "lastModifiedTime": "A String", # Output only. The time when this routine was last modified, in milliseconds |
| 757 | # since the epoch. |
| 758 | "returnType": { # The type of a variable, e.g., a function argument. # Optional if language = "SQL"; required otherwise. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 759 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 760 | # If absent, the return type is inferred from definition_body at query time |
| 761 | # in each query that references this routine. If present, then the evaluated |
| 762 | # result will be cast to the specified returned type at query time. |
| 763 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 764 | # For example, for the functions created with the following statements: |
| 765 | # |
| 766 | # * `CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y);` |
| 767 | # |
| 768 | # * `CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1));` |
| 769 | # |
| 770 | # * `CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1));` |
| 771 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 772 | # The return_type is `{type_kind: "FLOAT64"}` for `Add` and `Decrement`, and |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 773 | # is absent for `Increment` (inferred as FLOAT64 at query time). |
| 774 | # |
| 775 | # Suppose the function `Add` is replaced by |
| 776 | # `CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y);` |
| 777 | # |
| 778 | # Then the inferred return type of `Increment` is automatically changed to |
| 779 | # INT64 at query time, while the return type of `Decrement` remains FLOAT64. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 780 | # Examples: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 781 | # INT64: {type_kind="INT64"} |
| 782 | # ARRAY<STRING>: {type_kind="ARRAY", array_element_type="STRING"} |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 783 | # STRUCT<x STRING, y ARRAY<DATE>>: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 784 | # {type_kind="STRUCT", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 785 | # struct_type={fields=[ |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 786 | # {name="x", type={type_kind="STRING"}}, |
| 787 | # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 788 | # ]}} |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 789 | "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". |
| 790 | "fields": [ |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 791 | # Object with schema name: StandardSqlField |
| 792 | ], |
| 793 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 794 | "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". |
| 795 | "typeKind": "A String", # Required. The top level type of this field. |
| 796 | # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 797 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 798 | "language": "A String", # Optional. Defaults to "SQL". |
| 799 | "description": "A String", # Optional. [Experimental] The description of the routine if defined. |
| 800 | "etag": "A String", # Output only. A hash of this resource. |
| 801 | "definitionBody": "A String", # Required. The body of the routine. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 802 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 803 | # For functions, this is the expression in the AS clause. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 804 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 805 | # If language=SQL, it is the substring inside (but excluding) the |
| 806 | # parentheses. For example, for the function created with the following |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 807 | # statement: |
| 808 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 809 | # `CREATE FUNCTION JoinLines(x string, y string) as (concat(x, "\n", y))` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 810 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 811 | # The definition_body is `concat(x, "\n", y)` (\n is not replaced with |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 812 | # linebreak). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 813 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 814 | # If language=JAVASCRIPT, it is the evaluated string in the AS clause. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 815 | # For example, for the function created with the following statement: |
| 816 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 817 | # `CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n'` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 818 | # |
| 819 | # The definition_body is |
| 820 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 821 | # `return "\n";\n` |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 822 | # |
| 823 | # Note that both \n are replaced with linebreaks. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 824 | "creationTime": "A String", # Output only. The time when this routine was created, in milliseconds since |
| 825 | # the epoch. |
| 826 | "routineType": "A String", # Required. The type of routine. |
| 827 | "routineReference": { # Required. Reference describing the ID of this routine. |
| 828 | "projectId": "A String", # [Required] The ID of the project containing this routine. |
| 829 | "datasetId": "A String", # [Required] The ID of the dataset containing this routine. |
| 830 | "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. |
| 831 | }, |
| 832 | "arguments": [ # Optional. |
| 833 | { # Input/output argument of a function or a stored procedure. |
| 834 | "name": "A String", # Optional. The name of this argument. Can be absent for function return argument. |
| 835 | "argumentKind": "A String", # Optional. Defaults to FIXED_TYPE. |
| 836 | "mode": "A String", # Optional. Specifies whether the argument is input or output. |
| 837 | # Can be set for procedures only. |
| 838 | "dataType": { # The type of a variable, e.g., a function argument. # Required unless argument_kind = ANY_TYPE. |
| 839 | # Examples: |
| 840 | # INT64: {type_kind="INT64"} |
| 841 | # ARRAY<STRING>: {type_kind="ARRAY", array_element_type="STRING"} |
| 842 | # STRUCT<x STRING, y ARRAY<DATE>>: |
| 843 | # {type_kind="STRUCT", |
| 844 | # struct_type={fields=[ |
| 845 | # {name="x", type={type_kind="STRING"}}, |
| 846 | # {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} |
| 847 | # ]}} |
| 848 | "structType": { # The fields of this struct, in order, if type_kind = "STRUCT". |
| 849 | "fields": [ |
| 850 | # Object with schema name: StandardSqlField |
| 851 | ], |
| 852 | }, |
| 853 | "arrayElementType": # Object with schema name: StandardSqlDataType # The type of the array's elements, if type_kind = "ARRAY". |
| 854 | "typeKind": "A String", # Required. The top level type of this field. |
| 855 | # Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY"). |
| 856 | }, |
| 857 | }, |
| 858 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 859 | }</pre> |
| 860 | </div> |
| 861 | |
| 862 | </body></html> |