Insert

Creates a new routine in the dataset

34 variables
32 variables

Creates a new routine in the dataset

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • View and manage your data in Google BigQuery
  • View and manage your data across Google Cloud Platform services

Input

This building block consumes 34 input parameters

  = Parameter name
  = Format

projectId STRING Required

Project ID of the new routine

datasetId STRING Required

Dataset ID of the new routine

routineType ENUMERATION

Required

creationTime INTEGER

Output only. The time when this routine was created, in milliseconds since the epoch

routineReference OBJECT

routineReference.datasetId STRING

[Required] The ID of the dataset containing this routine

routineReference.routineId 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

routineReference.projectId STRING

[Required] The ID of the project containing this routine

arguments[] OBJECT

Input/output argument of a function or a stored procedure

arguments[].argumentKind ENUMERATION

Optional. Defaults to FIXED_TYPE

arguments[].mode ENUMERATION

Optional. Specifies whether the argument is input or output. Can be set for procedures only

arguments[].dataType OBJECT

The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT<x STRING, y ARRAY>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}}

arguments[].dataType.structType OBJECT

arguments[].dataType.arrayElementType OBJECT

The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT<x STRING, y ARRAY>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}}

arguments[].dataType.arrayElementType.typeKind ENUMERATION

Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY")

arguments[].dataType.typeKind ENUMERATION

Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY")

arguments[].name STRING

Optional. The name of this argument. Can be absent for function return argument

importedLibraries[] STRING

lastModifiedTime INTEGER

Output only. The time when this routine was last modified, in milliseconds since the epoch

language ENUMERATION

Optional. Defaults to "SQL"

returnType OBJECT

The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT<x STRING, y ARRAY>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}}

returnType.structType OBJECT

returnType.structType.fields[] OBJECT

A field or a column

returnType.structType.fields[].name STRING

Optional. The name of this field. Can be absent for struct fields

returnType.arrayElementType OBJECT

The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT<x STRING, y ARRAY>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}}

returnType.arrayElementType.structType OBJECT

returnType.arrayElementType.arrayElementType OBJECT

The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT<x STRING, y ARRAY>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}}

returnType.arrayElementType.arrayElementType.structType OBJECT

returnType.arrayElementType.arrayElementType.arrayElementType OBJECT

The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT<x STRING, y ARRAY>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}}

returnType.arrayElementType.arrayElementType.typeKind ENUMERATION

Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY")

returnType.arrayElementType.typeKind ENUMERATION

Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY")

returnType.typeKind ENUMERATION

Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY")

definitionBody STRING

Required. The body of the routine. For functions, this is the expression in the AS clause. If language=SQL, it is the substring inside (but excluding) the parentheses. For example, for the function created with the following statement create function JoinLines(x string, y string) as (concat(x, "\n", y)) definition_body = r'concat(x, "\n", y)' (\n is not replaced with linebreak). If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n' definition_body = 'return "\n";\n' (both \n are replaced with linebreaks)

etag STRING

Output only. A hash of this resource

Output

This building block provides 32 output parameters

  = Parameter name
  = Format

routineType ENUMERATION

Required

creationTime INTEGER

Output only. The time when this routine was created, in milliseconds since the epoch

routineReference OBJECT

routineReference.datasetId STRING

[Required] The ID of the dataset containing this routine

routineReference.routineId 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

routineReference.projectId STRING

[Required] The ID of the project containing this routine

arguments[] OBJECT

Input/output argument of a function or a stored procedure

arguments[].argumentKind ENUMERATION

Optional. Defaults to FIXED_TYPE

arguments[].mode ENUMERATION

Optional. Specifies whether the argument is input or output. Can be set for procedures only

arguments[].dataType OBJECT

The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT<x STRING, y ARRAY>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}}

arguments[].dataType.structType OBJECT

arguments[].dataType.arrayElementType OBJECT

The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT<x STRING, y ARRAY>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}}

arguments[].dataType.arrayElementType.typeKind ENUMERATION

Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY")

arguments[].dataType.typeKind ENUMERATION

Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY")

arguments[].name STRING

Optional. The name of this argument. Can be absent for function return argument

importedLibraries[] STRING

lastModifiedTime INTEGER

Output only. The time when this routine was last modified, in milliseconds since the epoch

language ENUMERATION

Optional. Defaults to "SQL"

returnType OBJECT

The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT<x STRING, y ARRAY>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}}

returnType.structType OBJECT

returnType.structType.fields[] OBJECT

A field or a column

returnType.structType.fields[].name STRING

Optional. The name of this field. Can be absent for struct fields

returnType.arrayElementType OBJECT

The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT<x STRING, y ARRAY>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}}

returnType.arrayElementType.structType OBJECT

returnType.arrayElementType.arrayElementType OBJECT

The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT<x STRING, y ARRAY>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}}

returnType.arrayElementType.arrayElementType.structType OBJECT

returnType.arrayElementType.arrayElementType.arrayElementType OBJECT

The type of a variable, e.g., a function argument. Examples: INT64: {type_kind="INT64"} ARRAY: {type_kind="ARRAY", array_element_type="STRING"} STRUCT<x STRING, y ARRAY>: {type_kind="STRUCT", struct_type={fields=[ {name="x", type={type_kind="STRING"}}, {name="y", type={type_kind="ARRAY", array_element_type="DATE"}} ]}}

returnType.arrayElementType.arrayElementType.typeKind ENUMERATION

Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY")

returnType.arrayElementType.typeKind ENUMERATION

Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY")

returnType.typeKind ENUMERATION

Required. The top level type of this field. Can be any standard SQL data type (e.g., "INT64", "DATE", "ARRAY")

definitionBody STRING

Required. The body of the routine. For functions, this is the expression in the AS clause. If language=SQL, it is the substring inside (but excluding) the parentheses. For example, for the function created with the following statement create function JoinLines(x string, y string) as (concat(x, "\n", y)) definition_body = r'concat(x, "\n", y)' (\n is not replaced with linebreak). If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS 'return "\n";\n' definition_body = 'return "\n";\n' (both \n are replaced with linebreaks)

etag STRING

Output only. A hash of this resource