按日期时间分区 Google BigQuery
Partition by datetime Google BigQuery
情况:
我想在 Google BigQuery table 上加载 ~5B 条记录。我有一个名为 'date_time' 的字段,用于描述记录日期时间(从 2012 年到今天)。我希望 BigQuery table 在此字段上进行分区。
并发症:
我正在将所有记录流式传输到 BigQuery table,并且 BigQuery 似乎只接受分区的最近 12 个月的记录。
问题:
我已阅读说明 (https://cloud.google.com/bigquery/docs/partitioned-tables),但我仍然不明白如何以允许 partitioning/indexing 在我的 'date_time' 字段上的方式传输数据。
当前的流媒体限制在此link
中定义
You can stream data between 1 year in the past and 6 months in the future. Data outside of this range is rejected. When the data is streamed, data between 7 days in the past and 3 days in the future is placed in the streaming buffer, and then it is extracted to the corresponding partitions. Data outside of this window (but inside the 1 year, 6 month range) is placed in the UNPARTITIONED partition. When there's enough unpartitioned data, it is loaded to the corresponding partitions.
正如@Felipe 在 answer 中所建议的那样,您应该将数据流式传输到非分区 table 并使用 copy/load 操作将其移动到您的分区 table
注意:您只需为流式插入付费,因此此类解决方法不涉及额外费用
情况: 我想在 Google BigQuery table 上加载 ~5B 条记录。我有一个名为 'date_time' 的字段,用于描述记录日期时间(从 2012 年到今天)。我希望 BigQuery table 在此字段上进行分区。
并发症: 我正在将所有记录流式传输到 BigQuery table,并且 BigQuery 似乎只接受分区的最近 12 个月的记录。
问题: 我已阅读说明 (https://cloud.google.com/bigquery/docs/partitioned-tables),但我仍然不明白如何以允许 partitioning/indexing 在我的 'date_time' 字段上的方式传输数据。
当前的流媒体限制在此link
中定义You can stream data between 1 year in the past and 6 months in the future. Data outside of this range is rejected. When the data is streamed, data between 7 days in the past and 3 days in the future is placed in the streaming buffer, and then it is extracted to the corresponding partitions. Data outside of this window (but inside the 1 year, 6 month range) is placed in the UNPARTITIONED partition. When there's enough unpartitioned data, it is loaded to the corresponding partitions.
正如@Felipe 在 answer 中所建议的那样,您应该将数据流式传输到非分区 table 并使用 copy/load 操作将其移动到您的分区 table
注意:您只需为流式插入付费,因此此类解决方法不涉及额外费用