[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.
This commit is contained in:
Reynold Xin 2016-11-19 21:57:09 -08:00
parent d93b655247
commit bce9a03677

View file

@ -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 {