array_sort lambda function
Presto provides an array_sort function to sort arrays in ascending order with nulls placed at the end.
presto> select array_sort(array[2, 5, null, 1, -1]);
_col0
---------------------
[-1, 1, 2, 5, null]
There is also an array_sort_desc function that sorts arrays in descending order with nulls placed at the end.
presto> select array_sort_desc(array[2, 5, null, 1, -1]);
_col0
---------------------
[5, 2, 1, -1, null]
Both array_sort and array_sort_desc place nulls at the end of the array.






