This page says of collect_list:
Returns a list of objects with duplicates.
Is that list ordered? For example, the order of the query results?
This page says of collect_list:
Returns a list of objects with duplicates.
Is that list ordered? For example, the order of the query results?
built-in
collect_list
isn't guaranteed to be ordered, even if you do anorder by
first (even if it did ensure order, doing it this way is a waste of time). Just use brickhouse collect; it ensures the elements are ordered.It's correct that
collect_list
isn't guaranteed to be ordered. The functionsort_array
will sort the result: