Skip to content
Snippets Groups Projects
Commit 94a9eed1 authored by Reynold Xin's avatar Reynold Xin
Browse files

[SPARK-18508][SQL] Fix documentation error for DateDiff


## What changes were proposed in this pull request?
The previous documentation and example for DateDiff was wrong.

## How was this patch tested?
Doc only change.

Author: Reynold Xin <rxin@databricks.com>

Closes #15937 from rxin/datediff-doc.

(cherry picked from commit bce9a036)
Signed-off-by: default avatarReynold Xin <rxin@databricks.com>
parent b0b2f108
No related branches found
No related tags found
No related merge requests found
......@@ -1101,11 +1101,14 @@ case class TruncDate(date: Expression, format: Expression)
* Returns the number of days from startDate to endDate.
*/
@ExpressionDescription(
usage = "_FUNC_(date1, date2) - Returns the number of days between `date1` and `date2`.",
usage = "_FUNC_(endDate, startDate) - Returns the number of days from `startDate` to `endDate`.",
extended = """
Examples:
> SELECT _FUNC_('2009-07-30', '2009-07-31');
> SELECT _FUNC_('2009-07-31', '2009-07-30');
1
> SELECT _FUNC_('2009-07-30', '2009-07-31');
-1
""")
case class DateDiff(endDate: Expression, startDate: Expression)
extends BinaryExpression with ImplicitCastInputTypes {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment