Class: Google::Apis::BigqueryV2::JobConfigurationQuery
- Inherits:
-
Object
- Object
- Google::Apis::BigqueryV2::JobConfigurationQuery
- 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
JobConfigurationQuery configures a BigQuery query job.
Instance Attribute Summary collapse
-
#allow_large_results ⇒ Boolean
(also: #allow_large_results?)
Optional.
-
#clustering ⇒ Google::Apis::BigqueryV2::Clustering
Configures table clustering.
-
#connection_properties ⇒ Array<Google::Apis::BigqueryV2::ConnectionProperty>
Connection properties which can modify the query behavior.
-
#continuous ⇒ Boolean
(also: #continuous?)
[Optional] Specifies whether the query should be executed as a continuous query.
-
#create_disposition ⇒ String
Optional.
-
#create_session ⇒ Boolean
(also: #create_session?)
If this property is true, the job creates a new session using a randomly generated session_id.
-
#default_dataset ⇒ Google::Apis::BigqueryV2::DatasetReference
Identifier for a dataset.
-
#destination_encryption_configuration ⇒ Google::Apis::BigqueryV2::EncryptionConfiguration
Configuration for Cloud KMS encryption settings.
-
#destination_table ⇒ Google::Apis::BigqueryV2::TableReference
Optional.
-
#flatten_results ⇒ Boolean
(also: #flatten_results?)
Optional.
-
#maximum_billing_tier ⇒ Fixnum
Optional.
-
#maximum_bytes_billed ⇒ Fixnum
Limits the bytes billed for this job.
-
#parameter_mode ⇒ String
GoogleSQL only.
-
#preserve_nulls ⇒ Boolean
(also: #preserve_nulls?)
[Deprecated] This property is deprecated.
-
#priority ⇒ String
Optional.
-
#query ⇒ String
[Required] SQL query text to execute.
-
#query_parameters ⇒ Array<Google::Apis::BigqueryV2::QueryParameter>
Query parameters for GoogleSQL queries.
-
#range_partitioning ⇒ Google::Apis::BigqueryV2::RangePartitioning
Range partitioning specification for the destination table.
-
#schema_update_options ⇒ Array<String>
Allows the schema of the destination table to be updated as a side effect of the query job.
-
#script_options ⇒ Google::Apis::BigqueryV2::ScriptOptions
Options related to script execution.
-
#system_variables ⇒ Google::Apis::BigqueryV2::SystemVariables
System variables given to a query.
-
#table_definitions ⇒ Hash<String,Google::Apis::BigqueryV2::ExternalDataConfiguration>
Optional.
-
#time_partitioning ⇒ Google::Apis::BigqueryV2::TimePartitioning
Time-based partitioning specification for the destination table.
-
#use_legacy_sql ⇒ Boolean
(also: #use_legacy_sql?)
Optional.
-
#use_query_cache ⇒ Boolean
(also: #use_query_cache?)
Optional.
-
#user_defined_function_resources ⇒ Array<Google::Apis::BigqueryV2::UserDefinedFunctionResource>
Describes user-defined function resources used in the query.
-
#write_disposition ⇒ String
Optional.
-
#write_incremental_results ⇒ Boolean
(also: #write_incremental_results?)
Optional.
Instance Method Summary collapse
-
#initialize(**args) ⇒ JobConfigurationQuery
constructor
A new instance of JobConfigurationQuery.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ JobConfigurationQuery
Returns a new instance of JobConfigurationQuery.
5511 5512 5513 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5511 def initialize(**args) update!(**args) end |
Instance Attribute Details
#allow_large_results ⇒ Boolean Also known as: allow_large_results?
Optional. If true and query uses legacy SQL dialect, allows the query to
produce arbitrarily large result tables at a slight cost in performance.
Requires destinationTable to be set. For GoogleSQL queries, this flag is
ignored and large results are always allowed. However, you must still set
destinationTable when result size exceeds the allowed maximum response size.
Corresponds to the JSON property allowLargeResults
5302 5303 5304 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5302 def allow_large_results @allow_large_results end |
#clustering ⇒ Google::Apis::BigqueryV2::Clustering
Configures table clustering.
Corresponds to the JSON property clustering
5308 5309 5310 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5308 def clustering @clustering end |
#connection_properties ⇒ Array<Google::Apis::BigqueryV2::ConnectionProperty>
Connection properties which can modify the query behavior.
Corresponds to the JSON property connectionProperties
5313 5314 5315 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5313 def connection_properties @connection_properties end |
#continuous ⇒ Boolean Also known as: continuous?
[Optional] Specifies whether the query should be executed as a continuous
query. The default value is false.
Corresponds to the JSON property continuous
5319 5320 5321 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5319 def continuous @continuous end |
#create_disposition ⇒ String
Optional. Specifies whether the job is allowed to create new tables. The
following values are supported: * CREATE_IF_NEEDED: If the table does not
exist, BigQuery creates the table. * CREATE_NEVER: The table must already
exist. If it does not, a 'notFound' error is returned in the job result. The
default value is CREATE_IF_NEEDED. Creation, truncation and append actions
occur as one atomic update upon job completion.
Corresponds to the JSON property createDisposition
5330 5331 5332 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5330 def create_disposition @create_disposition end |
#create_session ⇒ Boolean Also known as: create_session?
If this property is true, the job creates a new session using a randomly
generated session_id. To continue using a created session with subsequent
queries, pass the existing session identifier as a ConnectionProperty value.
The session identifier is returned as part of the SessionInfo message within
the query statistics. The new session's location will be set to Job.
JobReference.location if it is present, otherwise it's set to the default
location based on existing routing logic.
Corresponds to the JSON property createSession
5341 5342 5343 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5341 def create_session @create_session end |
#default_dataset ⇒ Google::Apis::BigqueryV2::DatasetReference
Identifier for a dataset.
Corresponds to the JSON property defaultDataset
5347 5348 5349 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5347 def default_dataset @default_dataset end |
#destination_encryption_configuration ⇒ Google::Apis::BigqueryV2::EncryptionConfiguration
Configuration for Cloud KMS encryption settings.
Corresponds to the JSON property destinationEncryptionConfiguration
5352 5353 5354 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5352 def destination_encryption_configuration @destination_encryption_configuration end |
#destination_table ⇒ Google::Apis::BigqueryV2::TableReference
Optional. Describes the table where the query results should be stored. This
property must be set for large results that exceed the maximum response size.
For queries that produce anonymous (cached) results, this field will be
populated by BigQuery.
Corresponds to the JSON property destinationTable
5360 5361 5362 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5360 def destination_table @destination_table end |
#flatten_results ⇒ Boolean Also known as: flatten_results?
Optional. If true and query uses legacy SQL dialect, flattens all nested and
repeated fields in the query results. allowLargeResults must be true if this
is set to false. For GoogleSQL queries, this flag is ignored and results are
never flattened.
Corresponds to the JSON property flattenResults
5368 5369 5370 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5368 def flatten_results @flatten_results end |
#maximum_billing_tier ⇒ Fixnum
Optional. [Deprecated] Maximum billing tier allowed for this query. The
billing tier controls the amount of compute resources allotted to the query,
and multiplies the on-demand cost of the query accordingly. A query that runs
within its allotted resources will succeed and indicate its billing tier in
statistics.query.billingTier, but if the query exceeds its allotted resources,
it will fail with billingTierLimitExceeded. WARNING: The billed byte amount
can be multiplied by an amount up to this number! Most users should not need
to alter this setting, and we recommend that you avoid introducing new uses of
it.
Corresponds to the JSON property maximumBillingTier
5382 5383 5384 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5382 def maximum_billing_tier @maximum_billing_tier end |
#maximum_bytes_billed ⇒ Fixnum
Limits the bytes billed for this job. Queries that will have bytes billed
beyond this limit will fail (without incurring a charge). If unspecified, this
will be set to your project default.
Corresponds to the JSON property maximumBytesBilled
5389 5390 5391 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5389 def maximum_bytes_billed @maximum_bytes_billed end |
#parameter_mode ⇒ String
GoogleSQL only. Set to POSITIONAL to use positional (?) query parameters or to
NAMED to use named (@myparam) query parameters in this query.
Corresponds to the JSON property parameterMode
5395 5396 5397 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5395 def parameter_mode @parameter_mode end |
#preserve_nulls ⇒ Boolean Also known as: preserve_nulls?
[Deprecated] This property is deprecated.
Corresponds to the JSON property preserveNulls
5400 5401 5402 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5400 def preserve_nulls @preserve_nulls end |
#priority ⇒ String
Optional. Specifies a priority for the query. Possible values include
INTERACTIVE and BATCH. The default value is INTERACTIVE.
Corresponds to the JSON property priority
5407 5408 5409 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5407 def priority @priority end |
#query ⇒ String
[Required] SQL query text to execute. The useLegacySql field can be used to
indicate whether the query uses legacy SQL or GoogleSQL.
Corresponds to the JSON property query
5413 5414 5415 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5413 def query @query end |
#query_parameters ⇒ Array<Google::Apis::BigqueryV2::QueryParameter>
Query parameters for GoogleSQL queries.
Corresponds to the JSON property queryParameters
5418 5419 5420 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5418 def query_parameters @query_parameters end |
#range_partitioning ⇒ Google::Apis::BigqueryV2::RangePartitioning
Range partitioning specification for the destination table. Only one of
timePartitioning and rangePartitioning should be specified.
Corresponds to the JSON property rangePartitioning
5424 5425 5426 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5424 def range_partitioning @range_partitioning end |
#schema_update_options ⇒ Array<String>
Allows the schema of the destination table to be updated as a side effect of
the query job. Schema update options are supported in three cases: when
writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE_DATA;
when writeDisposition is WRITE_TRUNCATE and the destination table is a
partition of a table, specified by partition decorators. For normal tables,
WRITE_TRUNCATE will always overwrite the schema. One or more of the following
values are specified: * ALLOW_FIELD_ADDITION: allow adding a nullable field to
the schema. * ALLOW_FIELD_RELAXATION: allow relaxing a required field in the
original schema to nullable.
Corresponds to the JSON property schemaUpdateOptions
5437 5438 5439 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5437 def @schema_update_options end |
#script_options ⇒ Google::Apis::BigqueryV2::ScriptOptions
Options related to script execution.
Corresponds to the JSON property scriptOptions
5442 5443 5444 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5442 def @script_options end |
#system_variables ⇒ Google::Apis::BigqueryV2::SystemVariables
System variables given to a query.
Corresponds to the JSON property systemVariables
5447 5448 5449 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5447 def system_variables @system_variables end |
#table_definitions ⇒ Hash<String,Google::Apis::BigqueryV2::ExternalDataConfiguration>
Optional. You can specify external table definitions, which operate as
ephemeral tables that can be queried. These definitions are configured using a
JSON map, where the string key represents the table identifier, and the value
is the corresponding external data configuration object.
Corresponds to the JSON property tableDefinitions
5455 5456 5457 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5455 def table_definitions @table_definitions end |
#time_partitioning ⇒ Google::Apis::BigqueryV2::TimePartitioning
Time-based partitioning specification for the destination table. Only one of
timePartitioning and rangePartitioning should be specified.
Corresponds to the JSON property timePartitioning
5461 5462 5463 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5461 def time_partitioning @time_partitioning end |
#use_legacy_sql ⇒ Boolean Also known as: use_legacy_sql?
Optional. Specifies whether to use BigQuery's legacy SQL dialect for this
query. The default value is true. If set to false, the query will use BigQuery'
s GoogleSQL: https://cloud.google.com/bigquery/sql-reference/ When
useLegacySql is set to false, the value of flattenResults is ignored; query
will be run as if flattenResults is false.
Corresponds to the JSON property useLegacySql
5470 5471 5472 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5470 def use_legacy_sql @use_legacy_sql end |
#use_query_cache ⇒ Boolean Also known as: use_query_cache?
Optional. Whether to look for the result in the query cache. The query cache
is a best-effort cache that will be flushed whenever tables in the query are
modified. Moreover, the query cache is only available when a query does not
have a destination table specified. The default value is true.
Corresponds to the JSON property useQueryCache
5479 5480 5481 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5479 def use_query_cache @use_query_cache end |
#user_defined_function_resources ⇒ Array<Google::Apis::BigqueryV2::UserDefinedFunctionResource>
Describes user-defined function resources used in the query.
Corresponds to the JSON property userDefinedFunctionResources
5485 5486 5487 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5485 def user_defined_function_resources @user_defined_function_resources end |
#write_disposition ⇒ String
Optional. Specifies the action that occurs if the destination table already
exists. The following values are supported: * WRITE_TRUNCATE: If the table
already exists, BigQuery overwrites the data, removes the constraints, and
uses the schema from the query result. * WRITE_TRUNCATE_DATA: If the table
already exists, BigQuery overwrites the data, but keeps the constraints and
schema of the existing table. * WRITE_APPEND: If the table already exists,
BigQuery appends the data to the table. * WRITE_EMPTY: If the table already
exists and contains data, a 'duplicate' error is returned in the job result.
The default value is WRITE_EMPTY. Each action is atomic and only occurs if
BigQuery is able to complete the job successfully. Creation, truncation and
append actions occur as one atomic update upon job completion.
Corresponds to the JSON property writeDisposition
5500 5501 5502 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5500 def write_disposition @write_disposition end |
#write_incremental_results ⇒ Boolean Also known as: write_incremental_results?
Optional. This is only supported for a SELECT query using a temporary table.
If set, the query is allowed to write results incrementally to the temporary
result table. This may incur a performance penalty. This option cannot be used
with Legacy SQL. This feature is not yet available.
Corresponds to the JSON property writeIncrementalResults
5508 5509 5510 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5508 def write_incremental_results @write_incremental_results end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 5516 def update!(**args) @allow_large_results = args[:allow_large_results] if args.key?(:allow_large_results) @clustering = args[:clustering] if args.key?(:clustering) @connection_properties = args[:connection_properties] if args.key?(:connection_properties) @continuous = args[:continuous] if args.key?(:continuous) @create_disposition = args[:create_disposition] if args.key?(:create_disposition) @create_session = args[:create_session] if args.key?(:create_session) @default_dataset = args[:default_dataset] if args.key?(:default_dataset) @destination_encryption_configuration = args[:destination_encryption_configuration] if args.key?(:destination_encryption_configuration) @destination_table = args[:destination_table] if args.key?(:destination_table) @flatten_results = args[:flatten_results] if args.key?(:flatten_results) @maximum_billing_tier = args[:maximum_billing_tier] if args.key?(:maximum_billing_tier) @maximum_bytes_billed = args[:maximum_bytes_billed] if args.key?(:maximum_bytes_billed) @parameter_mode = args[:parameter_mode] if args.key?(:parameter_mode) @preserve_nulls = args[:preserve_nulls] if args.key?(:preserve_nulls) @priority = args[:priority] if args.key?(:priority) @query = args[:query] if args.key?(:query) @query_parameters = args[:query_parameters] if args.key?(:query_parameters) @range_partitioning = args[:range_partitioning] if args.key?(:range_partitioning) @schema_update_options = args[:schema_update_options] if args.key?(:schema_update_options) @script_options = args[:script_options] if args.key?(:script_options) @system_variables = args[:system_variables] if args.key?(:system_variables) @table_definitions = args[:table_definitions] if args.key?(:table_definitions) @time_partitioning = args[:time_partitioning] if args.key?(:time_partitioning) @use_legacy_sql = args[:use_legacy_sql] if args.key?(:use_legacy_sql) @use_query_cache = args[:use_query_cache] if args.key?(:use_query_cache) @user_defined_function_resources = args[:user_defined_function_resources] if args.key?(:user_defined_function_resources) @write_disposition = args[:write_disposition] if args.key?(:write_disposition) @write_incremental_results = args[:write_incremental_results] if args.key?(:write_incremental_results) end |