หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Returns the first date which is later than the value of the date column based on second week day argument.
For the corresponding Databricks SQL function, see next_day function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.next_day(date=<date>, dayOfWeek=<dayOfWeek>)
Parameters
| Parameter | Type | Description |
|---|---|---|
date |
pyspark.sql.Column or str |
target column to compute on. |
dayOfWeek |
literal string |
day of the week, case-insensitive, accepts: "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" |
Returns
pyspark.sql.Column: the column of computed results.
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('2015-07-27',)], ['dt'])
df.select('*', dbf.next_day(df.dt, 'Sun')).show()
df.select('*', dbf.next_day('dt', 'Sat')).show()