snowflake.snowpark.functions.date_from_parts

snowflake.snowpark.functions.date_from_parts(y: Union[Column, str, int], m: Union[Column, str, int], d: Union[Column, str, int]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L4376-L4394)

Creates a date from individual numeric components that represent the year, month, and day of the month.

Example::
>>> df = session.create_dataframe([[2022, 4, 1]], schema=["year", "month", "day"])
>>> df.select(date_from_parts("year", "month", "day")).collect()
[Row(DATE_FROM_PARTS("YEAR", "MONTH", "DAY")=datetime.date(2022, 4, 1))]
>>> session.table("dual").select(date_from_parts(2022, 4, 1)).collect()
[Row(DATE_FROM_PARTS(2022, 4, 1)=datetime.date(2022, 4, 1))]
Copy
语言: 中文