【问题标题】:Load partitioned BigQuery table from partitioned ORC从分区 ORC 加载分区 BigQuery 表
【发布时间】:2021-05-10 19:56:51
【问题描述】:

我想通过分区 ORC 中的mydate 列创建 BigQuery 分区表。

GCS 中的文件:

mydate=2021-04-01/*.orc
...
mydate=2021-04-30/*.orc

命令 bq:

bq load --source_format=ORC --time_partitioning_field mydate --time_partitioning_type DAY mydataset.mytable gs://mydata/*.orc

当我运行此命令时,出现此错误:The field specified for partitioning cannot be found in the schema 因为mydate 不在 ORC 文件中。

我该如何管理?

感谢您的帮助,祝您有美好的一天。

【问题讨论】:

    标签: google-bigquery google-cloud-storage orc


    【解决方案1】:

    我认为我们可以通过提供通过 source_uri_prefix 字段编码的自定义分区键架构来做到这一点。

    使用下面与分区模式检测模式相关的链接和示例 [1] 和 [2],我认为您可以做到。 [1]https://cloud.google.com/bigquery/docs/hive-partitioned-loads-gcs#command-line-tool [2]https://cloud.google.com/bigquery/docs/hive-partitioned-loads-gcs

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-13
      • 2021-08-15
      • 1970-01-01
      • 1970-01-01
      • 2015-05-09
      相关资源
      最近更新 更多