流式传输到 BQ 分区表

Streaming into BQ partitioned tables

我正在尝试使用数据流流式传输到 BQ 分区 table。 文档说:

Data in the streaming buffer has a NULL value for the _PARTITIONTIME column.

我可以看到将行插入日期分区时的情况 table。

有没有办法能够设置我要插入的行的分区时间,以便 BigQuery 可以推断出正确的分区?

到目前为止我已经尝试过:tableRow.set("_PARTITIONTIME", milliessinceepoch); 但我遇到了 no such field 异常。

AFAIK,截至撰写本文时,BigQuery 不允许手动指定每行的分区 - 它是从插入时间推断的。

但是,作为 BigQuery 内置分区表功能的替代方案,您可以使用 Dataflow 的功能同时流式传输到多个 BigQuery 表:请参阅 Sharding BigQuery output tables

大约一个月前,您可以流式传输到日期分区的特定分区 table。例如,要插入 table T 中日期 20160501 的分区,您可以使用 table 名称 T160501

调用 insertall