排序bigquerystorage读取API
如标题所述,使用存储读取API构建的读取流读取的数据是否有任何形式的顺序?关于分区和群集键是否有任何顺序,因为我知道分区是共归结的,如果使用了群集,则分区中的数据存储在群集块中?
As the title states, is there any sort order for the data read using the read streams constructed with the Storage Read API? Is there any ordering with respect to partitions and clustering keys, as I understand partitions are colocated and if clustering is used, the data in a partition is stored in clustered blocks?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于第一个问题
存储api在直接。无法使用存储读取API对您接收数据的哪个顺序做出假设。
对于群集表中的第二个问题,
每当将新数据添加到表或特定分区时,数据就会自动组织。 rel =“ nofollow noreferrer”>分区表doc 和
当您在的情况下使用
群集时,将其应用于整个数据集。如果表为
分区表
,则将其应用于每个分区。您可以关注此代码实验室更好的理解。来自实验室: -
将此
stackoverflow.question_2018
表作为示例。假设它具有3列如果我们从具有

create_date
作为日期分区的主表中创建一个新的分区表,则根据分区逻辑,它将在每个创建日期都有一个分区。现在,如果我们创建一个表
create_date
作为分区,并应用cluster
on column tags tags ,则聚类将是应用于每个分区。即使我们在此表中添加新数据,BigQuery也会照顾重新组织数据。希望这可以帮助您理解。
For the 1st Question
Storage API operates on storage directly.Thus you really can’t make assumptions regarding in which order you will receive the data by using Storage Read API.
For the 2nd Question
In a clustered table the data gets automatically organized whenever new data is added to a table or specific partition.From the partitioned table doc and clustered table doc
When you are using
cluster by
with some columns , it gets applied to the whole dataset. If the table is apartitioned table
then it will be applied to each partition.You can follow this code lab for a better understanding. From the lab:-
Consider this
stackoverflow.question_2018
table as an example. Let's assume it has 3 columnsIf we create a new partitioned table from the main table having

creation_date
as date partition , then as per partitioning logic it will have a partition for every creation date.Now if we create a table
creation_date
as a partition and applycluster by
on columntags
then clustering will be applied to each of the partitions. Even if we add new data in this table , bigquery will take care of reorganizing the data.Hope this helps you to understand.
存储读取API可以在多个流中返回数据。根据每个流的数据如何组合在一起,最终结果可能会或可能不会保留原始订单
Storage Read API can return data in multiple streams. Depending on how the data from each stream are put together, the final result may or may not preserve the original order