Class: Google::Cloud::Bigquery::QueryJob::Updater
- Inherits:
-
Google::Cloud::Bigquery::QueryJob
- Object
- Job
- Google::Cloud::Bigquery::QueryJob
- Google::Cloud::Bigquery::QueryJob::Updater
- Defined in:
- lib/google/cloud/bigquery/query_job.rb
Overview
Yielded to a block to accumulate changes for a patch request.
Attributes collapse
-
#cache=(value) ⇒ Object
Specifies to look in the query cache for results.
-
#create=(value) ⇒ Object
Sets the create disposition for creating the query results table.
-
#dataset=(value) ⇒ Object
Sets the default dataset of tables referenced in the query.
-
#encryption=(val) ⇒ Object
Sets the encryption configuration of the destination table.
-
#external=(value) ⇒ Object
Sets definitions for external tables used in the query.
-
#flatten=(value) ⇒ Object
Flatten nested and repeated fields in legacy SQL queries.
-
#labels=(value) ⇒ Object
Sets the labels to use for the job.
-
#large_results=(value) ⇒ Object
Allow large results for a legacy SQL query.
-
#legacy_sql=(value) ⇒ Object
Sets the query syntax to legacy SQL.
-
#location=(value) ⇒ Object
Sets the geographic location where the job should run.
-
#maximum_bytes_billed=(value) ⇒ Object
Sets the maximum bytes billed for the query.
-
#params=(params) ⇒ Object
Sets the query parameters.
-
#priority=(value) ⇒ Object
Sets the priority of the query.
-
#standard_sql=(value) ⇒ Object
Sets the query syntax to standard SQL.
-
#table=(value) ⇒ Object
Sets the destination for the query results table.
-
#udfs=(value) ⇒ Object
Sets user defined functions for the query.
-
#write=(value) ⇒ Object
Sets the write disposition for when the query results table exists.
Methods inherited from Google::Cloud::Bigquery::QueryJob
#batch?, #bytes_processed, #cache?, #cache_hit?, #data, #destination, #encryption, #flatten?, #interactive?, #large_results?, #legacy_sql?, #maximum_billing_tier, #maximum_bytes_billed, #query_plan, #standard_sql?, #udfs, #wait_until_done!
Methods inherited from Job
#cancel, #configuration, #created_at, #done?, #ended_at, #error, #errors, #failed?, #job_id, #labels, #location, #pending?, #project_id, #reload!, #rerun!, #running?, #started_at, #state, #statistics, #status, #user_email, #wait_until_done!
Instance Method Details
#cache=(value) ⇒ Object
Specifies to look in the query cache for results.
433 434 435 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 433 def cache= value @gapi.configuration.query.use_query_cache = value end |
#create=(value) ⇒ Object
Sets the create disposition for creating the query results table.
create new tables. The default value is needed
.
The following values are supported:
needed
- Create the table if it does not exist.never
- The table must already exist. A 'notFound' error is raised if the table does not exist.
522 523 524 525 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 522 def create= value @gapi.configuration.query.create_disposition = Convert.create_disposition value end |
#dataset=(value) ⇒ Object
Sets the default dataset of tables referenced in the query.
470 471 472 473 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 470 def dataset= value @gapi.configuration.query.default_dataset = @service.dataset_ref_from value end |
#encryption=(val) ⇒ Object
Sets the encryption configuration of the destination table.
675 676 677 678 679 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 675 def encryption= val @gapi.configuration.query.update!( destination_encryption_configuration: val.to_gapi ) end |
#external=(value) ⇒ Object
Sets definitions for external tables used in the query.
630 631 632 633 634 635 636 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 630 def external= value external_table_pairs = value.map do |name, obj| [String(name), obj.to_gapi] end external_table_hash = Hash[external_table_pairs] @gapi.configuration.query.table_definitions = external_table_hash end |
#flatten=(value) ⇒ Object
Flatten nested and repeated fields in legacy SQL queries.
459 460 461 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 459 def flatten= value @gapi.configuration.query.flatten_results = value end |
#labels=(value) ⇒ Object
Sets the labels to use for the job.
584 585 586 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 584 def labels= value @gapi.configuration.update! labels: value end |
#large_results=(value) ⇒ Object
Allow large results for a legacy SQL query.
446 447 448 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 446 def large_results= value @gapi.configuration.query.allow_large_results = value end |
#legacy_sql=(value) ⇒ Object
Sets the query syntax to legacy SQL.
600 601 602 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 600 def legacy_sql= value @gapi.configuration.query.use_legacy_sql = value end |
#location=(value) ⇒ Object
Sets the geographic location where the job should run. Required except for US and EU.
403 404 405 406 407 408 409 410 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 403 def location= value @gapi.job_reference.location = value return unless value.nil? # Treat assigning value of nil the same as unsetting the value. unset = @gapi.job_reference.instance_variables.include? :@location @gapi.job_reference.remove_instance_variable :@location if unset end |
#maximum_bytes_billed=(value) ⇒ Object
Sets the maximum bytes billed for the query.
567 568 569 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 567 def maximum_bytes_billed= value @gapi.configuration.query.maximum_bytes_billed = value end |
#params=(params) ⇒ Object
Sets the query parameters. Standard SQL only.
487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 487 def params= params case params when Array then @gapi.configuration.query.use_legacy_sql = false @gapi.configuration.query.parameter_mode = "POSITIONAL" @gapi.configuration.query.query_parameters = params.map do |param| Convert.to_query_param param end when Hash then @gapi.configuration.query.use_legacy_sql = false @gapi.configuration.query.parameter_mode = "NAMED" @gapi.configuration.query.query_parameters = params.map do |name, param| Convert.to_query_param(param).tap do |named_param| named_param.name = String name end end else raise "Query parameters must be an Array or a Hash." end end |
#priority=(value) ⇒ Object
Sets the priority of the query.
419 420 421 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 419 def priority= value @gapi.configuration.query.priority = priority_value value end |
#standard_sql=(value) ⇒ Object
Sets the query syntax to standard SQL.
616 617 618 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 616 def standard_sql= value @gapi.configuration.query.use_legacy_sql = !value end |
#table=(value) ⇒ Object
Sets the destination for the query results table.
554 555 556 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 554 def table= value @gapi.configuration.query.destination_table = table_ref_from value end |
#udfs=(value) ⇒ Object
Sets user defined functions for the query.
650 651 652 653 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 650 def udfs= value @gapi.configuration.query.user_defined_function_resources = udfs_gapi_from value end |
#write=(value) ⇒ Object
Sets the write disposition for when the query results table exists.
541 542 543 544 |
# File 'lib/google/cloud/bigquery/query_job.rb', line 541 def write= value @gapi.configuration.query.write_disposition = Convert.write_disposition value end |