public static class Routine.Builder extends RoutineInfo.Builder
| Modifier and Type | Method and Description |
|---|---|
Routine |
build()
Creates a
RoutineInfo 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 |
setImportedLibraries(List<String> libraries)
Optional.
|
Routine.Builder |
setLanguage(String language)
Sets the language for the routine (e.g.
|
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.
|
public Routine.Builder setRoutineType(String routineType)
RoutineInfo.BuilderSee https://cloud.google.com/bigquery/docs/reference/rest/v2/routines
setRoutineType in class RoutineInfo.Builderpublic Routine.Builder setLanguage(String language)
RoutineInfo.BuildersetLanguage in class RoutineInfo.Builderpublic Routine.Builder setArguments(List<RoutineArgument> arguments)
RoutineInfo.BuildersetArguments in class RoutineInfo.Builderpublic Routine.Builder setReturnType(StandardSQLDataType returnType)
RoutineInfo.BuilderOptional 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.
setReturnType in class RoutineInfo.Builderpublic Routine.Builder setImportedLibraries(List<String> libraries)
RoutineInfo.BuildersetImportedLibraries in class RoutineInfo.Builderpublic Routine.Builder setBody(String body)
RoutineInfo.BuilderFor 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.
setBody in class RoutineInfo.Builderpublic Routine build()
RoutineInfo.BuilderRoutineInfo object.build in class RoutineInfo.BuilderCopyright © 2019 Google LLC. All rights reserved.