snowflake.snowpark.functions.as_date¶
- snowflake.snowpark.functions.as_date(variant: Union[Column, str]) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L5986-L6000)¶
Casts a VARIANT value to a date.
- Example::
>>> df = session.sql("select date'2020-1-1'::variant as a") >>> df.select(as_date("a").alias("result")).show() -------------- |"RESULT" | -------------- |2020-01-01 | --------------