Reputation: 193
I am working on BigQuery and I am still new to it.
Can somebody please help me on below questions?
1. Create new non partitioned table with _partitiontime field in it.
2. Export table structure in SQL of table (partitioned tables on date) from BigQuery.
3. Create new non partitioned table from partitioned table with exact structure.
Tagging this question to java for more visibility.
Upvotes: 0
Views: 191
Reputation: 1551
bq mk my_data_set.my_new_table bq cp my_data_set.partitioned_table my_data_set.my_new_table
Please note that the un-partitioned table will not have the _partitiontime field. It's a pseudo column so it will not be copied over. If you do need it, you can run a query like this and save it to table:
bq query --destination_table=my_data_set.my_new_table 'SELECT *, _partitiontime AS partition_time FROM my_data_set.partitioned_table'
Upvotes: 1