snowflake.snowpark.functions.array_sort¶
- snowflake.snowpark.functions.array_sort(array: Union[Column, str], sort_ascending: Optional[bool] = True, nulls_first: Optional[bool] = False) Column[source]¶
Returns rows of array column in sorted order. Users can choose the sort order and decide where to keep null elements.
Make sure BCR 2023_05 Bundle is enabled before using this function.
- Parameters:
array – name of the column or column element which describes the column
sort_ascending – Boolean that decides if array elements are sorted in ascending order. Defaults to True.
nulls_first – Boolean that decides if SQL null elements will be placed in the beginning of the array. Note that this does not affect JSON null. Defaults to False.
- Examples::
- Behavior with SQL nulls:
- Behavior with JSON nulls: