public static class Routine.Builder extends RoutineInfo.Builder
Methods
build()
public Routine build()
Creates a RoutineInfo
object.
Type | Description |
Routine |
setArguments(List<RoutineArgument> arguments)
public Routine.Builder setArguments(List<RoutineArgument> arguments)
Specifies the list of input/output arguments for the routine.
Name | Description |
arguments | List<RoutineArgument> |
Type | Description |
Routine.Builder |
setBody(String body)
public Routine.Builder setBody(String body)
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.
Name | Description |
body | String |
Type | Description |
Routine.Builder |
setDescription(String description)
public Routine.Builder setDescription(String description)
Name | Description |
description | String |
Type | Description |
Routine.Builder |
setDeterminismLevel(String determinismLevel)
public Routine.Builder setDeterminismLevel(String determinismLevel)
Sets the JavaScript UDF determinism levels (e.g. DETERMINISM_LEVEL_UNSPECIFIED, DETERMINISTIC, NOT_DETERMINISTIC) only applicable to Javascript UDFs.
Name | Description |
determinismLevel | String |
Type | Description |
Routine.Builder |
setImportedLibraries(List<String> libraries)
public Routine.Builder setImportedLibraries(List<String> libraries)
Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries as a list of gs:// URLs.
Name | Description |
libraries | List<String> |
Type | Description |
Routine.Builder |
setLanguage(String language)
public Routine.Builder setLanguage(String language)
Sets the language for the routine (e.g. SQL or JAVASCRIPT)
Name | Description |
language | String |
Type | Description |
Routine.Builder |
setRemoteFunctionOptions(RemoteFunctionOptions remoteFunctionOptions)
public Routine.Builder setRemoteFunctionOptions(RemoteFunctionOptions remoteFunctionOptions)
Optional. Remote function specific options.
Name | Description |
remoteFunctionOptions | RemoteFunctionOptions |
Type | Description |
Routine.Builder |
setReturnTableType(StandardSQLTableType returnTableType)
public Routine.Builder setReturnTableType(StandardSQLTableType returnTableType)
Optional. Set only if Routine is a "TABLE_VALUED_FUNCTION".
Name | Description |
returnTableType | StandardSQLTableType |
Type | Description |
Routine.Builder |
setReturnType(StandardSQLDataType returnType)
public Routine.Builder setReturnType(StandardSQLDataType returnType)
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.
Name | Description |
returnType | StandardSQLDataType |
Type | Description |
Routine.Builder |
setRoutineType(String routineType)
public Routine.Builder setRoutineType(String routineType)
Sets the routine type for the Builder (e.g. SCALAR_FUNCTION).
See https://cloud.google.com/bigquery/docs/reference/rest/v2/routines
Name | Description |
routineType | String |
Type | Description |
Routine.Builder |