Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
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.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.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()