Class: Google::Apis::BigqueryV2::Routine

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/bigquery_v2/classes.rb,
lib/google/apis/bigquery_v2/representations.rb,
lib/google/apis/bigquery_v2/representations.rb

Overview

A user-defined function or a stored procedure.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Routine

Returns a new instance of Routine.



6809
6810
6811
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6809

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#argumentsArray<Google::Apis::BigqueryV2::Argument>

Optional. Corresponds to the JSON property arguments



6703
6704
6705
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6703

def arguments
  @arguments
end

#creation_timeFixnum

Output only. The time when this routine was created, in milliseconds since the epoch. Corresponds to the JSON property creationTime

Returns:

  • (Fixnum)


6709
6710
6711
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6709

def creation_time
  @creation_time
end

#data_governance_typeString

Optional. Data governance specific option, if the value is DATA_MASKING, the function will be validated as masking functions. Corresponds to the JSON property dataGovernanceType

Returns:

  • (String)


6715
6716
6717
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6715

def data_governance_type
  @data_governance_type
end

#definition_bodyString

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 definition_body 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 definition_body is return "\n";\n Note that both \n are replaced with linebreaks. Corresponds to the JSON property definitionBody

Returns:

  • (String)


6729
6730
6731
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6729

def definition_body
  @definition_body
end

#descriptionString

Optional. The description of the routine, if defined. Corresponds to the JSON property description

Returns:

  • (String)


6734
6735
6736
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6734

def description
  @description
end

#determinism_levelString

Optional. The determinism level of the JavaScript UDF, if defined. Corresponds to the JSON property determinismLevel

Returns:

  • (String)


6739
6740
6741
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6739

def determinism_level
  @determinism_level
end

#etagString

Output only. A hash of this resource. Corresponds to the JSON property etag

Returns:

  • (String)


6744
6745
6746
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6744

def etag
  @etag
end

#imported_librariesArray<String>

Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT libraries. Corresponds to the JSON property importedLibraries

Returns:

  • (Array<String>)


6750
6751
6752
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6750

def imported_libraries
  @imported_libraries
end

#languageString

Optional. Defaults to "SQL" if remote_function_options field is absent, not set otherwise. Corresponds to the JSON property language

Returns:

  • (String)


6756
6757
6758
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6756

def language
  @language
end

#last_modified_timeFixnum

Output only. The time when this routine was last modified, in milliseconds since the epoch. Corresponds to the JSON property lastModifiedTime

Returns:

  • (Fixnum)


6762
6763
6764
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6762

def last_modified_time
  @last_modified_time
end

#remote_function_optionsGoogle::Apis::BigqueryV2::RemoteFunctionOptions

Options for a remote user-defined function. Corresponds to the JSON property remoteFunctionOptions



6767
6768
6769
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6767

def remote_function_options
  @remote_function_options
end

#return_table_typeGoogle::Apis::BigqueryV2::StandardSqlTableType

A table type Corresponds to the JSON property returnTableType



6772
6773
6774
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6772

def return_table_type
  @return_table_type
end

#return_typeGoogle::Apis::BigqueryV2::StandardSqlDataType

The data type of a variable such as a function argument. Examples include: * INT64: "typeKind": "INT64" * ARRAY: "typeKind": "ARRAY", " arrayElementType":"typeKind": "STRING" * STRUCT>: "typeKind": "STRUCT", "structType": "fields": [ "name": "x", "type":"typeKind": "STRING", "name": "y", "type": "typeKind": "ARRAY", "arrayElementType": "typeKind": " DATE" ] Corresponds to the JSON property returnType



6782
6783
6784
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6782

def return_type
  @return_type
end

#routine_referenceGoogle::Apis::BigqueryV2::RoutineReference

Required. Reference describing the ID of this routine. Corresponds to the JSON property routineReference



6787
6788
6789
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6787

def routine_reference
  @routine_reference
end

#routine_typeString

Required. The type of routine. Corresponds to the JSON property routineType

Returns:

  • (String)


6792
6793
6794
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6792

def routine_type
  @routine_type
end

#spark_optionsGoogle::Apis::BigqueryV2::SparkOptions

Options for a user-defined Spark routine. Corresponds to the JSON property sparkOptions



6797
6798
6799
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6797

def spark_options
  @spark_options
end

#strict_modeBoolean Also known as: strict_mode?

Optional. Can be set for procedures only. If true (default), the definition body will be validated in the creation and the updates of the procedure. For procedures with an argument of ANY TYPE, the definition body validtion is not supported at creation/update time, and thus this field must be set to false explicitly. Corresponds to the JSON property strictMode

Returns:

  • (Boolean)


6806
6807
6808
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6806

def strict_mode
  @strict_mode
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6814

def update!(**args)
  @arguments = args[:arguments] if args.key?(:arguments)
  @creation_time = args[:creation_time] if args.key?(:creation_time)
  @data_governance_type = args[:data_governance_type] if args.key?(:data_governance_type)
  @definition_body = args[:definition_body] if args.key?(:definition_body)
  @description = args[:description] if args.key?(:description)
  @determinism_level = args[:determinism_level] if args.key?(:determinism_level)
  @etag = args[:etag] if args.key?(:etag)
  @imported_libraries = args[:imported_libraries] if args.key?(:imported_libraries)
  @language = args[:language] if args.key?(:language)
  @last_modified_time = args[:last_modified_time] if args.key?(:last_modified_time)
  @remote_function_options = args[:remote_function_options] if args.key?(:remote_function_options)
  @return_table_type = args[:return_table_type] if args.key?(:return_table_type)
  @return_type = args[:return_type] if args.key?(:return_type)
  @routine_reference = args[:routine_reference] if args.key?(:routine_reference)
  @routine_type = args[:routine_type] if args.key?(:routine_type)
  @spark_options = args[:spark_options] if args.key?(:spark_options)
  @strict_mode = args[:strict_mode] if args.key?(:strict_mode)
end