Class Routine.Builder
- Enclosing class:
- Routine
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates aRoutineInfoobject.setArguments(List<RoutineArgument> arguments) Specifies the list of input/output arguments for the routine.Required.setDataGovernanceType(String dataGovernanceType) Sets the data governance type for the Builder (e.g.setDescription(String description) setDeterminismLevel(String determinismLevel) Sets the JavaScript UDF determinism levels (e.g.setImportedLibraries(List<String> libraries) Optional.setLanguage(String language) Sets the language for the routine (e.g.setRemoteFunctionOptions(RemoteFunctionOptions remoteFunctionOptions) Optional.setReturnTableType(StandardSQLTableType returnTableType) Optional.setReturnType(StandardSQLDataType returnType) Sets the return type of the routine.setRoutineType(String routineType) Sets the routine type for the Builder (e.g.
-
Method Details
-
setRoutineType
Description copied from class:RoutineInfo.BuilderSets the routine type for the Builder (e.g. SCALAR_FUNCTION).See https://cloud.google.com/bigquery/docs/reference/rest/v2/routines
- Specified by:
setRoutineTypein classRoutineInfo.Builder
-
setDescription
-
setDeterminismLevel
Description copied from class:RoutineInfo.BuilderSets the JavaScript UDF determinism levels (e.g. DETERMINISM_LEVEL_UNSPECIFIED, DETERMINISTIC, NOT_DETERMINISTIC) only applicable to Javascript UDFs.- Specified by:
setDeterminismLevelin classRoutineInfo.Builder
-
setLanguage
Description copied from class:RoutineInfo.BuilderSets the language for the routine (e.g. SQL or JAVASCRIPT)- Specified by:
setLanguagein classRoutineInfo.Builder
-
setArguments
Description copied from class:RoutineInfo.BuilderSpecifies the list of input/output arguments for the routine.- Specified by:
setArgumentsin classRoutineInfo.Builder
-
setReturnType
Description copied from class:RoutineInfo.BuilderSets 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.
- Specified by:
setReturnTypein classRoutineInfo.Builder
-
setReturnTableType
Description copied from class:RoutineInfo.BuilderOptional. Set only if Routine is a "TABLE_VALUED_FUNCTION".- Specified by:
setReturnTableTypein classRoutineInfo.Builder
-
setImportedLibraries
Description copied from class:RoutineInfo.BuilderOptional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries as a list of gs:// URLs.- Specified by:
setImportedLibrariesin classRoutineInfo.Builder
-
setBody
Description copied from class:RoutineInfo.BuilderRequired. 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 definitionBody 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 definitionBody is
return "\n";\n
Note that both \n are replaced with linebreaks.
- Specified by:
setBodyin classRoutineInfo.Builder
-
setRemoteFunctionOptions
Description copied from class:RoutineInfo.BuilderOptional. Remote function specific options.- Specified by:
setRemoteFunctionOptionsin classRoutineInfo.Builder- Returns:
-
setDataGovernanceType
Description copied from class:RoutineInfo.BuilderSets the data governance type for the Builder (e.g. DATA_MASKING).See https://cloud.google.com/bigquery/docs/reference/rest/v2/routines
- Specified by:
setDataGovernanceTypein classRoutineInfo.Builder
-
build
Description copied from class:RoutineInfo.BuilderCreates aRoutineInfoobject.- Specified by:
buildin classRoutineInfo.Builder
-