gpt4 book ai didi

hive - Hive 的 collect_list 是否有序?

转载 作者:行者123 更新时间:2023-12-05 01:34:21 31 4
gpt4 key购买 nike

This page说到 collect_list:

Returns a list of objects with duplicates.

那个 list 是有序的吗?比如查询结果的顺序?

最佳答案

正确的是collect_list不保证会被订购。函数sort_array将对结果进行排序:

   select a, b, sort_array(collect_list(c)) as sorted_c
from the_table
group by a, b

关于hive - Hive 的 collect_list 是否有序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31350150/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com