Skip to content

Commit

Permalink
feat: use Primary location unless location is set explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
joker1007 committed Dec 13, 2024
1 parent 430fe61 commit 8c9150b
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 8c9150b

Please sign in to comment.