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

snowflake.snowpark.functions.object_delete

snowflake.snowpark.functions.object_delete(obj: Union[Column, str], key1: Union[Column, str], *keys: Union[Column, str]) Column[source]

Returns an object consisting of the input object with one or more keys removed. The input key must not exist in the object.

Example:

>>> from snowflake.snowpark.functions import lit
>>> df = session.sql(
...     "select object_construct(a,b,c,d,e,f) as obj from "
...     "values('age', 21, 'zip', 21021, 'name', 'Joe'),"
...     "('age', 26, 'zip', 94021, 'name', 'Jay') as T(a,b,c,d,e,f)"
... )
>>> df.select(object_delete(col("obj"), lit("age")).alias("result")).show()
--------------------
|"RESULT"          |
--------------------
|{                 |
|  "name": "Joe",  |
|  "zip": 21021    |
|}                 |
|{                 |
|  "name": "Jay",  |
|  "zip": 94021    |
|}                 |
--------------------
Copy