How to atomically rename a table?

204 views
Skip to first unread message

Александр Павлов

unread,
May 19, 2020, 11:31:18 AM5/19/20
to Google Cloud Bigtable Discuss
I have case with sync data to BigQeury.
1. I create temp table with name `my1_temp`.
2. I insert data to `my1_temp`.
3. I want replace `my1_temp` to `my1` after sync data.

How to atomically rename a table for my case?

Ramesh Dharan

unread,
May 19, 2020, 11:38:29 AM5/19/20
to Google Cloud Bigtable Discuss
Not sure if you want to rename on the Bigtable side or BigQuery side, but it kind of doesn't matter since unfortunately neither Bigtable nor BigQuery supports renaming an existing table: 

If you want to do the rename on the BigQuery side you may want to look at this guide:

On the Bigtable side, we don't have either rename or copy table, so the only way to move data from one table ID to another is to export and re-import it. We may add easier copying facilities in the future, but we are very unlikely to add an atomic table rename since that's impossible to do in Bigtable's distributed, eventually consistent architecture (we only support row-level atomicity). 
Reply all
Reply to author
Forward
0 new messages