Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using CLI for data load into column type partitioning: Incompatible table partitioning specification

At a simple BQ load some CSVs to a new schema using this cmd we get the below error:

bq load --time_partitioning_field saved_timestamp
--skip_leading_rows=1 --max_bad_records=100 --allow_jagged_rows 
--replace --source_format=CSV --ignore_unknown_values  TABLE gs://.../export*.gz schema.json

Incompatible table partitioning specification. Expects partitioning specification none, but input partitioning specification is interval(type:day,field:saved_timestamp)

My expectation would be to create a column type partitioning column. What's wrong?

Also can we use the same syntax to specify Clustering?

like image 271
Pentium10 Avatar asked Oct 26 '25 10:10

Pentium10


1 Answers

At the time of this writing, there is a limitation that you cannot replace a table and change the partitioning specification at the same time, which is listed as a limitation of CREATE TABLE statements as well. When using the BigQuery CLI, you can:

  • Load the data into a new table with the desired partitioning/clustering spec,
  • Drop the table intended to be replaced (bq rm dataset.table),
  • Copy the new table to the name of the old one (bq cp dataset.new_table dataset.table), then
  • Drop the new table (bq rm dataset.new_table).
like image 187
Elliott Brossard Avatar answered Oct 28 '25 04:10

Elliott Brossard



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!