Vikash Pareek
Vikash Pareek

Reputation: 1181

Copying BigQuery result to another table is not working?

I have noticed one weird problem on BigQuery in last 2-3 days, earlier it was working fine.

I have a bigquery table in a dataset located in EU region. I am running a simple SELECT query on that table and it ran without any issue. Now, I am trying to save that query result into another bigquery table in the same dataset, it is giving below error -

To copy a table, the destination and source datasets must be in the same region. Copy an entire dataset to move data between regions.

Strange part is that, other alternatives are working fine, such as -

  1. Copying the source table to new table is working fine.
  2. When I set the destination table in the query setting and run the query then it is able to save the query result into that configured table.
  3. I ran the query and access the temporary table where BigQuery actually stores the query result and then copy that temporary table to destination table, this is also working.

Not sure why only the save result option is not working, it was working before though.

Anyone has any idea if something has changed on GCP recently?

Upvotes: 1

Views: 1640

Answers (4)

Prajna Rai T
Prajna Rai T

Reputation: 1828

I tried to save query results as the BigQuery table as below, I manually gave the Dataset name and it worked.

enter image description here

Upvotes: 1

Vishal Bulbule
Vishal Bulbule

Reputation: 307

Tried to reproduce issue

Error when i typed dataset name manually.

enter image description here

Successfull When I selected dataset from drop-down - Strange

enter image description here

Upvotes: 0

Michel K
Michel K

Reputation: 711

You can try to create or replace table 'abc.de.omg' AS SELECT .... to store the same result.

edit: another workaround is to set it up as a schedule query and run it as a backfill once.

On another note, anyone finding this can comment on the reported bug here: https://issuetracker.google.com/issues/233184546 (i'm not the original poster)

Upvotes: 1

Vishal Bulbule
Vishal Bulbule

Reputation: 307

This happens when you have source and destination dataset in different region.

you can share source and destination dataset screenshots to check the region.

Upvotes: 0

Related Questions