Class Routine.Builder (2.53.0)
Stay organized with collections
Save and categorize content based on your preferences.
publicstaticclass Routine.BuilderextendsRoutineInfo.BuilderInherited Members
Methods
build()
publicRoutinebuild()Creates a RoutineInfo object.
| Returns | |
|---|---|
| Type | Description |
Routine |
|
setArguments(List<RoutineArgument> arguments)
publicRoutine.BuildersetArguments(List<RoutineArgument>arguments)Specifies the list of input/output arguments for the routine.
| Parameter | |
|---|---|
| Name | Description |
arguments |
List<RoutineArgument> |
| Returns | |
|---|---|
| Type | Description |
Routine.Builder |
|
setBody(String body)
publicRoutine.BuildersetBody(Stringbody)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, " ", y))
The definitionBody is concat(x, " ", y) ( 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 " "; '
The definitionBody is
return " ";
Note that both are replaced with linebreaks.
| Parameter | |
|---|---|
| Name | Description |
body |
String |
| Returns | |
|---|---|
| Type | Description |
Routine.Builder |
|
setDataGovernanceType(String dataGovernanceType)
publicRoutine.BuildersetDataGovernanceType(StringdataGovernanceType)Sets the data governance type for the Builder (e.g. DATA_MASKING).
See https://cloud.google.com/bigquery/docs/reference/rest/v2/routines
| Parameter | |
|---|---|
| Name | Description |
dataGovernanceType |
String |
| Returns | |
|---|---|
| Type | Description |
Routine.Builder |
|
setDescription(String description)
publicRoutine.BuildersetDescription(Stringdescription)| Parameter | |
|---|---|
| Name | Description |
description |
String |
| Returns | |
|---|---|
| Type | Description |
Routine.Builder |
|
setDeterminismLevel(String determinismLevel)
publicRoutine.BuildersetDeterminismLevel(StringdeterminismLevel)Sets the JavaScript UDF determinism levels (e.g. DETERMINISM_LEVEL_UNSPECIFIED, DETERMINISTIC, NOT_DETERMINISTIC) only applicable to Javascript UDFs.
| Parameter | |
|---|---|
| Name | Description |
determinismLevel |
String |
| Returns | |
|---|---|
| Type | Description |
Routine.Builder |
|
setImportedLibraries(List<String> libraries)
publicRoutine.BuildersetImportedLibraries(List<String>libraries)Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries as a list of gs:// URLs.
| Parameter | |
|---|---|
| Name | Description |
libraries |
List<String> |
| Returns | |
|---|---|
| Type | Description |
Routine.Builder |
|
setLanguage(String language)
publicRoutine.BuildersetLanguage(Stringlanguage)Sets the language for the routine (e.g. SQL or JAVASCRIPT)
| Parameter | |
|---|---|
| Name | Description |
language |
String |
| Returns | |
|---|---|
| Type | Description |
Routine.Builder |
|
setRemoteFunctionOptions(RemoteFunctionOptions remoteFunctionOptions)
publicRoutine.BuildersetRemoteFunctionOptions(RemoteFunctionOptionsremoteFunctionOptions)Optional. Remote function specific options.
| Parameter | |
|---|---|
| Name | Description |
remoteFunctionOptions |
RemoteFunctionOptions |
| Returns | |
|---|---|
| Type | Description |
Routine.Builder |
|
setReturnTableType(StandardSQLTableType returnTableType)
publicRoutine.BuildersetReturnTableType(StandardSQLTableTypereturnTableType)Optional. Set only if Routine is a "TABLE_VALUED_FUNCTION".
| Parameter | |
|---|---|
| Name | Description |
returnTableType |
StandardSQLTableType |
| Returns | |
|---|---|
| Type | Description |
Routine.Builder |
|
setReturnType(StandardSQLDataType returnType)
publicRoutine.BuildersetReturnType(StandardSQLDataTypereturnType)Sets the return type of the routine.
Optional if language = "SQL"; required otherwise.
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.
| Parameter | |
|---|---|
| Name | Description |
returnType |
StandardSQLDataType |
| Returns | |
|---|---|
| Type | Description |
Routine.Builder |
|
setRoutineType(String routineType)
publicRoutine.BuildersetRoutineType(StringroutineType)Sets the routine type for the Builder (e.g. SCALAR_FUNCTION).
See https://cloud.google.com/bigquery/docs/reference/rest/v2/routines
| Parameter | |
|---|---|
| Name | Description |
routineType |
String |
| Returns | |
|---|---|
| Type | Description |
Routine.Builder |
|