how to rename a table without re creating it

user1516770 picture user1516770 · May 26, 2013 · Viewed 15.8k times · Source

I didn't find a RENAME option to alter table name. I have a case that I must rename a table, and the only way is to select with result to new table. this query cost money, and taking long time for no reason.

It is especially painful when I need to rename a nested table, so I must export, need to even work on the result set in order to import it back.

Any way that I am missing? anything coming soon?

Answer

Jordan Tigani picture Jordan Tigani · May 26, 2013

There is no rename option, but there is a copy operation, which uses a fast snapshot process. This doesn't incur any additional charges other than the additional cost of storage (of course you can delete the original table so you only get charged for the storage once).

You can do this in the BigQuery by clicking on the table name and the dropdown arrow next to the table name, then selecting 'copy table'. Alternately you can use the bq cp command in the bq command-line tool.