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