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
Instance Attribute Summary collapse
-
#allow_large_results ⇒ Boolean
(also: #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.
-
#clustering ⇒ Google::Apis::BigqueryV2::Clustering
[Beta] Clustering specification for the destination table.
-
#connection_properties ⇒ Array<Google::Apis::BigqueryV2::ConnectionProperty>
Connection properties.
-
#create_disposition ⇒ String
[Optional] Specifies whether the job is allowed to create new tables.
-
#create_session ⇒ Boolean
(also: #create_session?)
If true, creates a new session, where session id will be a server generated random id.
-
#default_dataset ⇒ Google::Apis::BigqueryV2::DatasetReference
[Optional] Specifies the default dataset to use for unqualified table names in the query.
-
#destination_encryption_configuration ⇒ Google::Apis::BigqueryV2::EncryptionConfiguration
Custom encryption configuration (e.g., Cloud KMS keys).
-
#destination_table ⇒ Google::Apis::BigqueryV2::TableReference
[Optional] Describes the table where the query results should be stored.
-
#flatten_results ⇒ Boolean
(also: #flatten_results?)
[Optional] If true and query uses legacy SQL dialect, flattens all nested and repeated fields in the query results.
-
#maximum_billing_tier ⇒ Fixnum
[Optional] Limits the billing tier for this job.
-
#maximum_bytes_billed ⇒ Fixnum
[Optional] Limits the bytes billed for this job.
-
#parameter_mode ⇒ String
Standard SQL only.
-
#preserve_nulls ⇒ Boolean
(also: #preserve_nulls?)
[Deprecated] This property is deprecated.
-
#priority ⇒ String
[Optional] Specifies a priority for the query.
-
#query ⇒ String
[Required] SQL query text to execute.
-
#query_parameters ⇒ Array<Google::Apis::BigqueryV2::QueryParameter>
Query parameters for standard SQL queries.
-
#range_partitioning ⇒ Google::Apis::BigqueryV2::RangePartitioning
[TrustedTester] Range partitioning specification for this table.
-
#schema_update_options ⇒ Array<String>
Allows the schema of the destination table to be updated as a side effect of the query job.
-
#table_definitions ⇒ Hash<String,Google::Apis::BigqueryV2::ExternalDataConfiguration>
[Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source.
-
#time_partitioning ⇒ Google::Apis::BigqueryV2::TimePartitioning
Time-based partitioning specification for the destination table.
-
#use_legacy_sql ⇒ Boolean
(also: #use_legacy_sql?)
Specifies whether to use BigQuery's legacy SQL dialect for this query.
-
#use_query_cache ⇒ Boolean
(also: #use_query_cache?)
[Optional] Whether to look for the result in the query cache.
-
#user_defined_function_resources ⇒ Array<Google::Apis::BigqueryV2::UserDefinedFunctionResource>
Describes user-defined function resources used in the query.
-
#write_disposition ⇒ String
[Optional] Specifies the action that occurs if the destination table already exists.
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.
4269 4270 4271 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4269 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 standard SQL 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
4097 4098 4099 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4097 def allow_large_results @allow_large_results end |
#clustering ⇒ Google::Apis::BigqueryV2::Clustering
[Beta] Clustering specification for the destination table. Must be specified
with time-based partitioning, data in the table will be first partitioned and
subsequently clustered.
Corresponds to the JSON property clustering
4105 4106 4107 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4105 def clustering @clustering end |
#connection_properties ⇒ Array<Google::Apis::BigqueryV2::ConnectionProperty>
Connection properties.
Corresponds to the JSON property connectionProperties
4110 4111 4112 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4110 def connection_properties @connection_properties 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
4120 4121 4122 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4120 def create_disposition @create_disposition end |
#create_session ⇒ Boolean Also known as: create_session?
If true, creates a new session, where session id will be a server generated
random id. If false, runs query with an existing session_id passed in
ConnectionProperty, otherwise runs query in non-session mode.
Corresponds to the JSON property createSession
4127 4128 4129 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4127 def create_session @create_session end |
#default_dataset ⇒ Google::Apis::BigqueryV2::DatasetReference
[Optional] Specifies the default dataset to use for unqualified table names in
the query. Note that this does not alter behavior of unqualified dataset names.
Corresponds to the JSON property defaultDataset
4134 4135 4136 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4134 def default_dataset @default_dataset end |
#destination_encryption_configuration ⇒ Google::Apis::BigqueryV2::EncryptionConfiguration
Custom encryption configuration (e.g., Cloud KMS keys).
Corresponds to the JSON property destinationEncryptionConfiguration
4139 4140 4141 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4139 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. If
not present, a new table will be created to store the results. This property
must be set for large results that exceed the maximum response size.
Corresponds to the JSON property destinationTable
4146 4147 4148 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4146 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 standard SQL queries, this flag is ignored and results
are never flattened.
Corresponds to the JSON property flattenResults
4154 4155 4156 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4154 def flatten_results @flatten_results end |
#maximum_billing_tier ⇒ Fixnum
[Optional] Limits the billing tier for this job. Queries that have resource
usage beyond this tier will fail (without incurring a charge). If unspecified,
this will be set to your project default.
Corresponds to the JSON property maximumBillingTier
4162 4163 4164 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4162 def maximum_billing_tier @maximum_billing_tier end |
#maximum_bytes_billed ⇒ Fixnum
[Optional] 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
4169 4170 4171 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4169 def maximum_bytes_billed @maximum_bytes_billed end |
#parameter_mode ⇒ String
Standard SQL 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
4175 4176 4177 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4175 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
4180 4181 4182 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4180 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
4187 4188 4189 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4187 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 standard SQL.
Corresponds to the JSON property query
4193 4194 4195 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4193 def query @query end |
#query_parameters ⇒ Array<Google::Apis::BigqueryV2::QueryParameter>
Query parameters for standard SQL queries.
Corresponds to the JSON property queryParameters
4198 4199 4200 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4198 def query_parameters @query_parameters end |
#range_partitioning ⇒ Google::Apis::BigqueryV2::RangePartitioning
[TrustedTester] Range partitioning specification for this table. Only one of
timePartitioning and rangePartitioning should be specified.
Corresponds to the JSON property rangePartitioning
4204 4205 4206 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4204 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 two cases: when
writeDisposition is WRITE_APPEND; 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
4216 4217 4218 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4216 def @schema_update_options end |
#table_definitions ⇒ Hash<String,Google::Apis::BigqueryV2::ExternalDataConfiguration>
[Optional] If querying an external data source outside of BigQuery, describes
the data format, location and other properties of the data source. By defining
these properties, the data source can then be queried as if it were a standard
BigQuery table.
Corresponds to the JSON property tableDefinitions
4224 4225 4226 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4224 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
4230 4231 4232 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4230 def time_partitioning @time_partitioning end |
#use_legacy_sql ⇒ Boolean Also known as: use_legacy_sql?
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 standard
SQL: 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
4239 4240 4241 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4239 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
4248 4249 4250 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4248 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
4254 4255 4256 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4254 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 table data and uses the schema from
the query result. 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
4267 4268 4269 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4267 def write_disposition @write_disposition end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 4274 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) @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) @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) end |