google_api_big_query v0.13.0 GoogleApi.BigQuery.V2.Model.Routine View Source

A user-defined function or a stored procedure.

Attributes

  • arguments (list(GoogleApi.BigQuery.V2.Model.Argument.t)): Optional. Defaults to nil.
  • creationTime (String.t): Output only. The time when this routine was created, in milliseconds since the epoch. Defaults to nil.
  • definitionBody (String.t): 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)) definition_body = r'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 " "; ' definition_body = 'return " "; ' (both are replaced with linebreaks). Defaults to nil.
  • etag (String.t): Output only. A hash of this resource. Defaults to nil.
  • importedLibraries (list(String.t)): Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries. Defaults to nil.
  • language (String.t): Optional. Defaults to "SQL". Defaults to nil.
  • lastModifiedTime (String.t): Output only. The time when this routine was last modified, in milliseconds since the epoch. Defaults to nil.
  • returnType (GoogleApi.BigQuery.V2.Model.StandardSqlDataType.t): Optional if language = "SQL"; required otherwise. If absent, the return type is inferred from definition_body 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.

For example, for the functions created with the following statements CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y); CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1)); CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1)); The return_type is {type_kind: "FLOAT64"} for Add and Decrement, and is absent for Increment (inferred as FLOAT64 at query time). Suppose the function Add is replaced by CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y); Then the inferred return type of Increment is automatically changed to INT64 at query time, while the return type of Decrement remains FLOAT64. Defaults to nil.

  • routineReference (GoogleApi.BigQuery.V2.Model.RoutineReference.t): Required. Reference describing the ID of this routine. Defaults to nil.
  • routineType (String.t): Required. Defaults to nil.

Link to this section Summary

Functions

Unwrap a decoded JSON object into its complex fields.

Link to this section Types

Link to this type

t() View Source
t() :: %GoogleApi.BigQuery.V2.Model.Routine{
  arguments: [GoogleApi.BigQuery.V2.Model.Argument.t()],
  creationTime: String.t(),
  definitionBody: String.t(),
  etag: String.t(),
  importedLibraries: [String.t()],
  language: String.t(),
  lastModifiedTime: String.t(),
  returnType: GoogleApi.BigQuery.V2.Model.StandardSqlDataType.t(),
  routineReference: GoogleApi.BigQuery.V2.Model.RoutineReference.t(),
  routineType: String.t()
}

Link to this section Functions

Link to this function

decode(value, options) View Source
decode(struct(), keyword()) :: struct()

Unwrap a decoded JSON object into its complex fields.