- Resource: Routine
- RoutineReference
- RoutineType
- Language
- Argument
- ArgumentKind
- Mode
- StandardSqlTableType
- DeterminismLevel
- RemoteFunctionOptions
- SparkOptions
- Methods
Resource: Routine
A user-defined function or a stored procedure.
JSON representation |
---|
{ "etag": string, "routineReference": { object ( |
Fields | |
---|---|
etag |
Output only. A hash of this resource. |
routineReference |
Required. Reference describing the ID of this routine. |
routineType |
Required. The type of routine. |
creationTime |
Output only. The time when this routine was created, in milliseconds since the epoch. |
lastModifiedTime |
Output only. The time when this routine was last modified, in milliseconds since the epoch. |
language |
Optional. Defaults to "SQL" if remoteFunctionOptions field is absent, not set otherwise. |
arguments[] |
Optional. |
returnType |
Optional if language = "SQL"; required otherwise. Cannot be set if routineType = "TABLE_VALUED_FUNCTION". If absent, the return type is inferred from definitionBody at query time in each query that references this routine. If present, then the evaluated result will be cast to the specified returned type at query time. For example, for the functions created with the following statements:
The returnType is Suppose the function Then the inferred return type of |
returnTableType |
Optional. Can be set only if routineType = "TABLE_VALUED_FUNCTION". If absent, the return table type is inferred from definitionBody at query time in each query that references this routine. If present, then the columns in the evaluated table result will be cast to match the column types specified in return table type, at query time. |
importedLibraries[] |
Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries. |
definitionBody |
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:
The definitionBody is If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement:
The definitionBody is
Note that both \n are replaced with linebreaks. |
description |
Optional. The description of the routine, if defined. |
determinismLevel |
Optional. The determinism level of the JavaScript UDF, if defined. |
remoteFunctionOptions |
Optional. Remote function specific options. |
sparkOptions |
Optional. Spark specific options. |
RoutineReference
Id path of a routine.
JSON representation |
---|
{ "projectId": string, "datasetId": string, "routineId": string } |
Fields | |
---|---|
projectId |
Required. The ID of the project containing this routine. |
datasetId |
Required. The ID of the dataset containing this routine. |
routineId |
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. |