ARRAY_SORT (Lakehouse v1)
Sorts elements in the array in ascending order.
Analyze Syntax
Section titled “Analyze Syntax”func.array_sort( <array>[, <order>, <nullposition>] )| Parameter | Default | Description |
|---|---|---|
| order | ASC | Specifies the sorting order as either ascending (ASC) or descending (DESC). |
| nullposition | NULLS FIRST | Determines the position of NULL values in the sorting result, at the beginning (NULLS FIRST) or at the end (NULLS LAST) of the sorting output. |
Analyze Examples
Section titled “Analyze Examples”func.array_sort([1, 4, 3, 2])
┌────────────────────────────────┐│ func.array_sort([1, 4, 3, 2]) │├────────────────────────────────┤│ [1,2,3,4] │└────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”ARRAY_SORT( <array>[, <order>, <nullposition>] )| Parameter | Default | Description |
|---|---|---|
| order | ASC | Specifies the sorting order as either ascending (ASC) or descending (DESC). |
| nullposition | NULLS FIRST | Determines the position of NULL values in the sorting result, at the beginning (NULLS FIRST) or at the end (NULLS LAST) of the sorting output. |
SQL Examples
Section titled “SQL Examples”SELECT ARRAY_SORT([1, 4, 3, 2]);
┌──────────────────────────┐│ array_sort([1, 4, 3, 2]) │├──────────────────────────┤│ [1,2,3,4] │└──────────────────────────┘