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

snowflake.snowpark.functions.get¶

snowflake.snowpark.functions.get(col1: ColumnOrName | int, col2: ColumnOrName | int) → Column[source]¶

Extracts a value from an object or array; returns NULL if either of the arguments is NULL.

Example:

>>> df = session.createDataFrame([([1, 2, 3],), ([],)], ["data"])
>>> df.select(get(df.data, 1).as_("idx1")).sort(col("idx1")).show()
----------
|"IDX1"  |
----------
|NULL    |
|2       |
----------
Copy