Skip to content

Commit

Permalink
Merge pull request #433 from GoogleCloudPlatform/grant-116968956
Browse files Browse the repository at this point in the history
BigQuery Snippets: Use autodetected location
  • Loading branch information
grant authored Jun 20, 2019
2 parents 2bbc431 + 3ec9c78 commit 2e2ca1b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bigquery/snippets/load_from_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ def load_from_file(dataset_id = "your_dataset_id",
dataset = bigquery.dataset dataset_id
table_id = "new_table_id"

# Infer the config.location based on the location of the referenced dataset.
load_job = dataset.load_job table_id, file_path do |config|
config.skip_leading = 1
config.autodetect = true
# Must match the destination dataset location.
config.location = "US"
end
load_job.wait_until_done! # Waits for table load to complete.

Expand Down

0 comments on commit 2e2ca1b

Please sign in to comment.