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.Builder
See https://cloud.google.com/bigquery/docs/reference/rest/v2/routines
setRoutineType
in class RoutineInfo.Builder
public Routine.Builder setLanguage(String language)
RoutineInfo.Builder
setLanguage
in class RoutineInfo.Builder
public Routine.Builder setArguments(List<RoutineArgument> arguments)
RoutineInfo.Builder
setArguments
in class RoutineInfo.Builder
public Routine.Builder setReturnType(StandardSQLDataType returnType)
RoutineInfo.Builder
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.
setReturnType
in class RoutineInfo.Builder
public Routine.Builder setImportedLibraries(List<String> libraries)
RoutineInfo.Builder
setImportedLibraries
in class RoutineInfo.Builder
public Routine.Builder setBody(String body)
RoutineInfo.Builder
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.
setBody
in class RoutineInfo.Builder
public Routine build()
RoutineInfo.Builder
RoutineInfo
object.build
in class RoutineInfo.Builder
Copyright © 2019 Google LLC. All rights reserved.