使用CLI将数据加载到列类型分区中:不兼容的表分区规范

时间:2018-08-29 11:44:26

标签: google-bigquery

使用此cmd在简单的BQ中将一些CSV加载到新架构中,我们将收到以下错误:

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
  

不兼容的表分区规范。期望分区   规范没有,但是输入分区规范是   时间间隔(类型:天,字段:保存时间戳)

我的期望是创建一个列类型的分区列。怎么了?

我们还可以使用相同的语法来指定聚类吗?

1 个答案:

答案 0 :(得分:1)

在撰写本文时,you cannot replace a table and change the partitioning specification at the same time有一个限制,它被列为limitation of CREATE TABLE statements as well。使用BigQuery CLI时,您可以:

  • 将数据加载到具有所需分区/集群规范的新表中,
  • 删除要替换的表(bq rm dataset.table
  • 将新表复制到旧表的名称(bq cp dataset.new_table dataset.table),然后
  • 删除新表(bq rm dataset.new_table)。