I have a table named dataset.table_20180801, and wanna make a new empty table dataset.table_20180901 which has the same schema as dataset.table_20180801. I wanna know the easiest way to do this in BigQuery.
I can copy table using BigQuery web console's copy table, but it copies the records too.
I think a easier way is to first get the schema using
bq show --schema --format=prettyjson dataset.table_20180801 > ~/Desktop/foo_bar_schema.json
and next make a table using it. (I wonder if this is right)
bq mk --table dataset.table_20180901 ~/Desktop/foo_bar_schema.json
But this way is not easy enough.
Is there any easier ways to copy schema?