pyspark.sql.functions.
next_day
Returns the first date which is later than the value of the date column based on second week day argument.
New in version 1.5.0.
Changed in version 3.4.0: Supports Spark Connect.
Column
target column to compute on.
“Mon”, “Tue”, “Wed”, “Thu”, “Fri”, “Sat”, “Sun”
the column of computed results.
Examples
>>> df = spark.createDataFrame([('2015-07-27',)], ['d']) >>> df.select(next_day(df.d, 'Sun').alias('date')).collect() [Row(date=datetime.date(2015, 8, 2))]