QuestionQ34

VerifiedUsing Spark SQL

What is the behavior of the function date_sub(start, days) when a negative value is passed to the days parameter?

Explanation

A negative day count reverses the subtraction: the absolute number of specified days is added to the start date. Databricks documents that a negative numDays value adds its absolute value to startDate.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!