ARRAY_SORTBY (Lakehouse v2)
Sorts elements of one array by corresponding elements of another array.
Analyze Syntax
Section titled “Analyze Syntax”func.array_sortby(get_column(table, 'names'), get_column(table, 'scores'))Analyze Examples
Section titled “Analyze Examples”func.array_sortby(['c','a','b'], [3,1,2])
┌───────────────┐│ ['a','b','c'] │└───────────────┘SQL Syntax
Section titled “SQL Syntax”ARRAY_SORTBY(<names>, <scores>)SQL Examples
Section titled “SQL Examples”SELECT ARRAY_SORTBY(['c','a','b'], [3,1,2]);
┌───────────────┐│ ["a","b","c"] │└───────────────┘