You are viewing documentation about an older version (1.6.1). View latest version

snowflake.snowpark.functions.sort_array¶

snowflake.snowpark.functions.sort_array(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.

Must enable parameter ENABLE_ARRAY_SORT_FUNCTION in your session.

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.