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] (https://github.com/snowflakedb/snowpark-python/blob/release-v1.3.0/src/snowflake/snowpark/functions.py#L4428-L4445)

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
语言: 中文