Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change clustered columns in an existing bigquery table

I have a partitioned and clustered table in bigquery. I would like to add another column to the set of clustered columns. I found out that the way to fix it is creating another table as you can see here Make existing bigquery table clustered, but I can't do it because my table is the source of a Data Studio dashboard where I have many calculated fields and I don't want to lose these fields.

Any suggestion? Thanks a lot!

Gustavo.

like image 221
Gustavo Schonhorst Avatar asked Oct 14 '25 14:10

Gustavo Schonhorst


1 Answers

You don't need a new table, although changing cluster column was not supported initially, it is supported afterwards (since early 2020).

Please check this documentation: https://cloud.google.com/bigquery/docs/creating-clustered-tables#modifying-cluster-spec

Unfortunately, the feature is only available through API right now.

(If you're not familiar with BigQuery API) It doesn't require you to write code, you can interact with API web interface here. For your one time maintenance, it may save you some time.

like image 80
Yun Zhang Avatar answered Oct 18 '25 07:10

Yun Zhang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!