snowflake.snowpark.functions.array_reverse

snowflake.snowpark.functions.array_reverse(col: Union[Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.32.0/src/snowflake/snowpark/functions.py#L5131-L5154)

Returns an array with the elements of the input array in reverse order.

Parameters:

col – The source array.

Example::
>>> df = session.sql("select [1, 2, 3, 4] :: ARRAY(INT) as A")
>>> df.select(array_reverse("A")).show()
--------------------------
|"ARRAY_REVERSE(""A"")"  |
--------------------------
|[                       |
|  4,                    |
|  3,                    |
|  2,                    |
|  1                     |
|]                       |
--------------------------
Copy
Language: English