Adelin
Adelin

Reputation: 19011

BigQuery Cannot read in location: asia

I am trying to query a federated table where the bucket is in

Multi-region    
asia (multiple regions in Asia)

. BigQuery dataset info

Data location:  
asia-south1

When I run a simple select * from ... I get:

Cannot read in location: asia

Upvotes: 0

Views: 2118

Answers (1)

Ricco D
Ricco D

Reputation: 7287

You encounter this error because your bucket is Multi region and your BigQuery dataset is regional. The general rule for location consideration is that the external data and the dataset should be in the same location.

As of now the available multi region BigQuery dataset is for US and EU. Thus the error when using Asia multi region for the external table. To fix this you can either:

  • Create a new bucket in asia-south1. Transfer your files from your old bucket using Cloud Storage Transfer service to the new bucket. Then create the dataset in asia-south1 as well and you should be able to query without errors.
  • If you want really want your data in a multi region setup, you can create a new bucket and BQ dataset which are both in US or EU. Just transfer your files to the new bucket and you would be able to execute queries.

NOTE: It is not possible to edit the location of the bucket. When you create a bucket, you permanently define its name, its geographic location, and the project it is part of. Thus the suggested fix mentioned above.

Upvotes: 2

Related Questions