next_day
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
Python
from pyspark.databricks.sql import functions as dbf
dbf.next_day(date=<date>, dayOfWeek=<dayOfWeek>)
Parameters
Parameter | Type | Description |
|---|---|---|
|
| target column to compute on. |
|
| day of the week, case-insensitive, accepts: "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" |
Returns
pyspark.sql.Column: the column of computed results.
Examples
Python
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()