หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Returns the last day of the month which the given date belongs to.
For the corresponding Databricks SQL function, see last_day function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.last_day(date=<date>)
Parameters
| Parameter | Type | Description |
|---|---|---|
date |
pyspark.sql.Column or str |
target column to compute on. |
Returns
pyspark.sql.Column: last day of the month.
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('1997-02-10',)], ['dt'])
df.select('*', dbf.last_day(df.dt)).show()
df.select('*', dbf.last_day('dt')).show()