Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/embulk/output/bigquery/bigquery_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def initialize(task, schema, fields = nil)
@destination_project = @task['destination_project']
@dataset = @task['dataset']
@location = @task['location']
@location_for_log = @location.nil? ? 'us/eu' : @location
@location_for_log = @location.nil? ? 'Primary location' : @location

@task['source_format'] ||= 'CSV'
@task['max_bad_records'] ||= 0
Expand Down Expand Up @@ -300,6 +300,7 @@ def wait_load(kind, response)

while true
job_id = _response.job_reference.job_id
location = @location || _response.job_reference.location
elapsed = Time.now - started
status = _response.status.state
if status == "DONE"
Expand All @@ -319,7 +320,7 @@ def wait_load(kind, response)
"job_id:[#{job_id}] elapsed_time:#{elapsed.to_f}sec status:[#{status}]"
}
sleep wait_interval
_response = with_network_retry { client.get_job(@project, job_id, location: @location) }
_response = with_network_retry { client.get_job(@project, job_id, location: location) }
end
end

Expand Down
Loading