在bigquery重复记录中的数据顺序 [英] Order of data in bigquery repeated records

查看:123
本文介绍了在bigquery重复记录中的数据顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何知道(或控制)使用聚合函数时重复字段中的记录以什么顺序返回?



如果我正在使用group_concat(children.name)children我可以假设连接顺序与插入到JSON中的表相同吗?



同样适用于第一个



有没有一种方法可以在不使用ORDER BY的情况下对数据进行排序,从资源的角度来看,这非常昂贵? (在尝试这样做时,我不断收到查询执行期间资源超出了)。

谢谢

解决方案

顺序应该保存在嵌套或重复字段中的记录中。



没有使用order by的排序方法。如果您只需要前几个值,可以尝试使用 TOP()或将其分解为两个查询并执行 WHERE 子句限制。例如。对于第一个查询,您可以找到一个分割点(可能使用 QUANTILES())您添加的第二个查询 WHERE字段< split_point

How do I know (or control) in what order the records in a repeated field will be returned when using aggregation function?

If for example I'm using "group_concat(children.name) within children" can I assume that the concatenation order will be the same as inserted to the table in the JSON?

Same applies to first(children.name) within children.

Is there a way to sort the data without using ORDER BY on the whole table which is extremely expensive from resources perspective? (I keep getting "Resources exceeded during query execution" when trying to do this).

Thanks

解决方案

Order should be preserved among records in a nested or repeated field.

There isn't a way to sort without using order by. If you only need the first few values, you can try using TOP() or splitting it up into two queries and doing a WHERE clause limitation. E.g. for the first query you find out a split point (perhaps using QUANTILES()) the second query you add WHERE field < split_point.

这篇关于在bigquery重复记录中的数据顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆