You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2016/11/20 05:57:13 UTC

spark git commit: [SPARK-18508][SQL] Fix documentation error for DateDiff

Repository: spark
Updated Branches:
  refs/heads/master d93b65524 -> bce9a0367


[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 <rx...@databricks.com>

Closes #15937 from rxin/datediff-doc.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/bce9a036
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/bce9a036
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/bce9a036

Branch: refs/heads/master
Commit: bce9a03677f931d52491e7768aba9e4a19a7e696
Parents: d93b655
Author: Reynold Xin <rx...@databricks.com>
Authored: Sat Nov 19 21:57:09 2016 -0800
Committer: Reynold Xin <rx...@databricks.com>
Committed: Sat Nov 19 21:57:09 2016 -0800

----------------------------------------------------------------------
 .../spark/sql/catalyst/expressions/datetimeExpressions.scala  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/bce9a036/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
----------------------------------------------------------------------
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
index 9cec6be..1db1d19 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
@@ -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 {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org