Class: Google::Cloud::Bigquery::CopyJob::Updater
- Inherits:
-
Google::Cloud::Bigquery::CopyJob
- Object
- Job
- Google::Cloud::Bigquery::CopyJob
- Google::Cloud::Bigquery::CopyJob::Updater
- Defined in:
- lib/google/cloud/bigquery/copy_job.rb
Overview
Yielded to a block to accumulate changes for an API request.
Attributes collapse
-
#create=(new_create) ⇒ Object
Sets the create disposition.
-
#encryption=(val) ⇒ Object
Sets the encryption configuration of the destination table.
-
#labels=(value) ⇒ Object
Sets the labels to use for the job.
-
#location=(value) ⇒ Object
Sets the geographic location where the job should run.
-
#write=(new_write) ⇒ Object
Sets the write disposition.
Methods inherited from Google::Cloud::Bigquery::CopyJob
#create_if_needed?, #create_never?, #destination, #encryption, #source, #write_append?, #write_empty?, #write_truncate?
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
#create=(new_create) ⇒ Object
Sets the create disposition.
This specifies whether the job is allowed to 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.
228 229 230 231 |
# File 'lib/google/cloud/bigquery/copy_job.rb', line 228 def create= new_create @gapi.configuration.copy.update! create_disposition: Convert.create_disposition(new_create) end |
#encryption=(val) ⇒ Object
Sets the encryption configuration of the destination table.
274 275 276 277 278 |
# File 'lib/google/cloud/bigquery/copy_job.rb', line 274 def encryption= val @gapi.configuration.copy.update!( destination_encryption_configuration: val.to_gapi ) end |
#labels=(value) ⇒ Object
Sets the labels to use for the job.
292 293 294 |
# File 'lib/google/cloud/bigquery/copy_job.rb', line 292 def labels= value @gapi.configuration.update! labels: value end |
#location=(value) ⇒ Object
Sets the geographic location where the job should run. Required except for US and EU.
204 205 206 207 208 209 210 211 |
# File 'lib/google/cloud/bigquery/copy_job.rb', line 204 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 |
#write=(new_write) ⇒ Object
Sets the write disposition.
This specifies how to handle data already present in the table. The
default value is append
.
The following values are supported:
truncate
- BigQuery overwrites the table data.append
- BigQuery appends the data to the table.empty
- An error will be returned if the table already contains data.
249 250 251 252 |
# File 'lib/google/cloud/bigquery/copy_job.rb', line 249 def write= new_write @gapi.configuration.copy.update! write_disposition: Convert.write_disposition(new_write) end |