Skip to main content

routines

Overview

Nameroutines
TypeResource
Idgoogle.bigquery.routines

Fields

NameDatatypeDescription
descriptionstringOptional. The description of the routine, if defined.
sparkOptionsobjectOptions for a user-defined Spark routine.
routineTypestringRequired. The type of routine.
definitionBodystringRequired. 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)) The definition_body is 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' The definition_body is return "\n";\n Note that both \n are replaced with linebreaks.
returnTableTypeobjectA table type
lastModifiedTimestringOutput only. The time when this routine was last modified, in milliseconds since the epoch.
determinismLevelstringOptional. The determinism level of the JavaScript UDF, if defined.
argumentsarrayOptional.
importedLibrariesarrayOptional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries.
routineReferenceobject
dataGovernanceTypestringOptional. Data governance specific option, if the value is DATA_MASKING, the function will be validated as masking functions.
remoteFunctionOptionsobjectOptions for a remote user-defined function.
creationTimestringOutput only. The time when this routine was created, in milliseconds since the epoch.
returnTypeobjectThe data type of a variable such as a function argument. Examples include: INT64: {"typeKind": "INT64"} ARRAY: { "typeKind": "ARRAY", "arrayElementType": {"typeKind": "STRING"} } * STRUCT>: { "typeKind": "STRUCT", "structType": { "fields": [ { "name": "x", "type": {"typeKind": "STRING"} }, { "name": "y", "type": { "typeKind": "ARRAY", "arrayElementType": {"typeKind": "DATE"} } } ] } }
strictModebooleanOptional. Can be set for procedures only. If true (default), the definition body will be validated in the creation and the updates of the procedure. For procedures with an argument of ANY TYPE, the definition body validtion is not supported at creation/update time, and thus this field must be set to false explicitly.
etagstringOutput only. A hash of this resource.
languagestringOptional. Defaults to "SQL" if remote_function_options field is absent, not set otherwise.

Methods

NameAccessible byRequired ParamsDescription
getSELECT+datasetId, +routineId, projectIdGets the specified routine resource by routine ID.
listSELECT+datasetId, projectIdLists all routines in the specified dataset. Requires the READER dataset role.
insertINSERT+datasetId, projectIdCreates a new routine in the dataset.
deleteDELETE+datasetId, +routineId, projectIdDeletes the routine specified by routineId from the dataset.
_listEXEC+datasetId, projectIdLists all routines in the specified dataset. Requires the READER dataset role.
updateEXEC+datasetId, +routineId, projectIdUpdates information in an existing routine. The update method replaces the entire Routine resource.