You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by aditkumar <gi...@git.apache.org> on 2018/03/09 16:17:32 UTC
[GitHub] spark pull request #20787: Documenting months_between direction
GitHub user aditkumar opened a pull request:
https://github.com/apache/spark/pull/20787
Documenting months_between direction
## What changes were proposed in this pull request?
It's useful to know what relationship between date1 and date2 result in a positive number.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aditkumar/spark master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/20787.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #20787
----
commit de207321717c607eccb280aa0b77b3393ef4a04b
Author: aditkumar <ad...@...>
Date: 2018-03-09T16:08:38Z
Date direction in months_between pyspark
commit 5f8a23fea197d60f870177ed3272154eab60bca9
Author: aditkumar <ad...@...>
Date: 2018-03-09T16:11:15Z
datediff direction in months_between
commit 1f5c543cf8e03b32691bbe477b09c4bce02e6f4d
Author: aditkumar <ad...@...>
Date: 2018-03-09T16:16:01Z
date direction in months_between
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/90321/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r186725257
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1194,13 +1194,21 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
}
/**
- * Returns number of months between dates date1 and date2.
+ * Returns number of months between dates `date1` and `date2`.
+ * If `date1` is later than `date2`, then the result is positive.
+ * If `date1` and `date2` are on the same day of month, or both
+ * are the last day of month, time of day will be ignored. Otherwise, the
+ * difference is calculated based on 31 days per month, and rounded to
+ * 8 digits unless roundOff=false.
*/
// scalastyle:off line.size.limit
@ExpressionDescription(
usage = """
- _FUNC_(timestamp1, timestamp2[, roundOff]) - Returns number of months between `timestamp1` and `timestamp2`.
- The result is rounded to 8 decimal places by default. Set roundOff=false otherwise."""",
+ _FUNC_(date1, date2[, roundOff]) - If `date1` is later than `date2`, then the result
--- End diff --
sorry if I wasn't clear. mind changing date1 and date2 to timestamp1 and timestamp2 here in `usage`?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:
https://github.com/apache/spark/pull/20787
LGTM
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #89635 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/89635/testReport)** for PR 20787 at commit [`6aa96ad`](https://github.com/apache/spark/commit/6aa96ad8fbc7bc561fce2324587c71945e18df52).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88521/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r181971230
--- Diff: R/pkg/R/functions.R ---
@@ -1957,8 +1958,11 @@ setMethod("levenshtein", signature(y = "Column"),
})
#' @details
-#' \code{months_between}: Returns number of months between dates \code{y} and \code{x}.
#'
+#' \code{months_between}: Returns number of months between dates \code{y} and \code{x}.
+#' If \code{y} is later than \code{x}, then the result is positive. If \code{y} and \code{x}
+#' are on the same day of month, or both are the last day of month, time of day will be ignored.
+#' Otherwise, the difference is calculated based on 31 days per month, and rounded to 8 digits.
#' @rdname column_datetime_diff_functions
--- End diff --
https://github.com/apache/spark/pull/20787#discussion_r177662053 roxygen is very particular with "empty line" which is significant. please change this to
```
#' @details
#' \code{months_between}: Returns number of months between dates \code{y} and \code{x}.
#' If \code{y} is later than \code{x}, then the result is positive. If \code{y} and \code{x}
#' are on the same day of month, or both are the last day of month, time of day will be ignored.
#' Otherwise, the difference is calculated based on 31 days per month, and rounded to 8 digits.
#'
#' @rdname column_datetime_diff_functions
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by aditkumar <gi...@git.apache.org>.
Github user aditkumar commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r186436718
--- Diff: R/pkg/R/functions.R ---
@@ -1906,6 +1906,7 @@ setMethod("atan2", signature(y = "Column"),
#' @details
#' \code{datediff}: Returns the number of days from \code{y} to \code{x}.
+#' If \code{y} is later than \code{x} then the result is positive.
--- End diff --
Done
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90204 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90204/testReport)** for PR 20787 at commit [`0f45552`](https://github.com/apache/spark/commit/0f45552e5bc4363183ec695553c0aaa79c53b66d).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88640/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90377 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90377/testReport)** for PR 20787 at commit [`accf9ff`](https://github.com/apache/spark/commit/accf9ff6368efc5bbbe42681fa89f79409ddd87a).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88521 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88521/testReport)** for PR 20787 at commit [`d330efb`](https://github.com/apache/spark/commit/d330efbcc0ee2be59eee5e8e99c585ed07fa77cd).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by aditkumar <gi...@git.apache.org>.
Github user aditkumar commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r186475229
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1194,13 +1194,21 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
}
/**
- * Returns number of months between dates date1 and date2.
+ * Returns number of months between dates `date1` and `date2`.
+ * If `date1` is later than `date2`, then the result is positive.
+ * If `date1` and `date2` are on the same day of month, or both
+ * are the last day of month, time of day will be ignored. Otherwise, the
+ * difference is calculated based on 31 days per month, and rounded to
+ * 8 digits unless roundOff=false.
*/
// scalastyle:off line.size.limit
@ExpressionDescription(
usage = """
- _FUNC_(timestamp1, timestamp2[, roundOff]) - Returns number of months between `timestamp1` and `timestamp2`.
- The result is rounded to 8 decimal places by default. Set roundOff=false otherwise."""",
+ _FUNC_(date1, date2[, roundOff]) - If `date1` is later than `date2`, then the result
--- End diff --
👍🏾
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/89465/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:
https://github.com/apache/spark/pull/20787
ok to test
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88640 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88640/testReport)** for PR 20787 at commit [`e74f259`](https://github.com/apache/spark/commit/e74f25997c5e56938d849d40190ecf9b967c55ad).
* This patch **fails Scala style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by aditkumar <gi...@git.apache.org>.
Github user aditkumar commented on the issue:
https://github.com/apache/spark/pull/20787
I'm not sure why this would fail unit tests..
`kafka.admin.AdminOperationException: replication factor: 1 larger than available brokers: 0
`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88420/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88407/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #89419 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/89419/testReport)** for PR 20787 at commit [`3ca9948`](https://github.com/apache/spark/commit/3ca99489a1a88d16f371091e86e4a58962e00759).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88419 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88419/testReport)** for PR 20787 at commit [`9afb314`](https://github.com/apache/spark/commit/9afb3140469f801d1f08c5b30e0698ec524fcc92).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88640 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88640/testReport)** for PR 20787 at commit [`e74f259`](https://github.com/apache/spark/commit/e74f25997c5e56938d849d40190ecf9b967c55ad).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/90153/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:
https://github.com/apache/spark/pull/20787
gentle ping @aditkumar
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88520 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88520/testReport)** for PR 20787 at commit [`56b699f`](https://github.com/apache/spark/commit/56b699f7a8eb805d734919f4f8c4b08b32b55ff0).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:
https://github.com/apache/spark/pull/20787
Let's fix https://github.com/apache/spark/blob/2ce37b50fc01558f49ad22f89c8659f50544ffec/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala#L1120-L1124 too while we are here.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: Documenting months_between direction
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r175668391
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1115,13 +1115,18 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
override def prettyName: String = "add_months"
}
-
/**
- * Returns number of months between dates date1 and date2.
- */
+ * Returns number of months between dates `date1` and `date2`.
+ * If `date1` is later than `date2`, then the result is positive.
--- End diff --
`date` -> `timestamp`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90167 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90167/testReport)** for PR 20787 at commit [`31a126f`](https://github.com/apache/spark/commit/31a126f4a6d3be102503639c6d09419a962e1f98).
* This patch **fails to build**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90377 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90377/testReport)** for PR 20787 at commit [`accf9ff`](https://github.com/apache/spark/commit/accf9ff6368efc5bbbe42681fa89f79409ddd87a).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90151 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90151/testReport)** for PR 20787 at commit [`208830e`](https://github.com/apache/spark/commit/208830e6592c3fc087faf5a55e1ebfb7c3493a81).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88639 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88639/testReport)** for PR 20787 at commit [`5d01c35`](https://github.com/apache/spark/commit/5d01c35aa20fe4173e513e2485a04e33f981ec77).
* This patch **fails Scala style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88407 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88407/testReport)** for PR 20787 at commit [`2de6aca`](https://github.com/apache/spark/commit/2de6acacbecdbc6a65cc956c682ae8a3ff4175d2).
* This patch **fails Scala style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #89465 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/89465/testReport)** for PR 20787 at commit [`913eed8`](https://github.com/apache/spark/commit/913eed849d218a34d6e28a2500301320ba21cecc).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r186277122
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1194,13 +1194,21 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
}
/**
- * Returns number of months between dates date1 and date2.
+ * Returns number of months between dates `date1` and `date2`.
+ * If `date1` is later than `date2`, then the result is positive.
+ * If `date1` and `date2` are on the same day of month, or both
+ * are the last day of month, time of day will be ignored. Otherwise, the
+ * difference is calculated based on 31 days per month, and rounded to
+ * 8 digits unless roundOff=false.
*/
// scalastyle:off line.size.limit
@ExpressionDescription(
usage = """
- _FUNC_(timestamp1, timestamp2[, roundOff]) - Returns number of months between `timestamp1` and `timestamp2`.
- The result is rounded to 8 decimal places by default. Set roundOff=false otherwise."""",
+ _FUNC_(date1, date2) - If `date1` is later than `date2`, then the result
--- End diff --
wait .. why did you change ` _FUNC_(timestamp1, timestamp2[, roundOff])`??
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90167 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90167/testReport)** for PR 20787 at commit [`31a126f`](https://github.com/apache/spark/commit/31a126f4a6d3be102503639c6d09419a962e1f98).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88523 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88523/testReport)** for PR 20787 at commit [`ef43d7b`](https://github.com/apache/spark/commit/ef43d7b747e5252af1f91e74e0b4e9c4cefef598).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #89465 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/89465/testReport)** for PR 20787 at commit [`913eed8`](https://github.com/apache/spark/commit/913eed849d218a34d6e28a2500301320ba21cecc).
* This patch **fails Spark unit tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88420 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88420/testReport)** for PR 20787 at commit [`264ed99`](https://github.com/apache/spark/commit/264ed994e2b74239907fdccc40544ca67d9b0531).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #89635 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/89635/testReport)** for PR 20787 at commit [`6aa96ad`](https://github.com/apache/spark/commit/6aa96ad8fbc7bc561fce2324587c71945e18df52).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88522/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88522 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88522/testReport)** for PR 20787 at commit [`0b11544`](https://github.com/apache/spark/commit/0b115442576dc53db7452681d7b2ec152a3ee7da).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/90377/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90321 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90321/testReport)** for PR 20787 at commit [`6a3ba4a`](https://github.com/apache/spark/commit/6a3ba4af43072b2e135855e1c04f6b2987cd94aa).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/20787
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:
https://github.com/apache/spark/pull/20787
Ping @aditkumar
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/89419/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90204 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90204/testReport)** for PR 20787 at commit [`0f45552`](https://github.com/apache/spark/commit/0f45552e5bc4363183ec695553c0aaa79c53b66d).
* This patch **fails to build**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by aditkumar <gi...@git.apache.org>.
Github user aditkumar commented on the issue:
https://github.com/apache/spark/pull/20787
This makes sense, I can make the changes this morning.
On Thu, Mar 15, 2018 at 8:55 AM Hyukjin Kwon <no...@github.com>
wrote:
> gentle ping @aditkumar <https://github.com/aditkumar>
>
> —
> You are receiving this because you were mentioned.
>
>
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/spark/pull/20787#issuecomment-373365934>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/ABee_1dz888e-9Az_C6y_mVdeW8Gb-snks5temS0gaJpZM4SkgK->
> .
>
--
Adit Kumar (US) +1 (201)-566-8630 (UK) +44 7415 930329 Sent via mobile
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88521 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88521/testReport)** for PR 20787 at commit [`d330efb`](https://github.com/apache/spark/commit/d330efbcc0ee2be59eee5e8e99c585ed07fa77cd).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r182701579
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1117,11 +1117,21 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
}
/**
- * Returns number of months between dates date1 and date2.
+ * Returns number of months between dates `timestamp1` and `timestamp2`.
+ * If `timestamp` is later than `timestamp2`, then the result is positive.
+ * If `timestamp1` and `timestamp2` are on the same day of month, or both
+ * are the last day of month, time of day will be ignored. Otherwise, the
+ * difference is calculated based on 31 days per month, and rounded to
+ * 8 digits.
*/
// scalastyle:off line.size.limit
@ExpressionDescription(
- usage = "_FUNC_(timestamp1, timestamp2) - Returns number of months between `timestamp1` and `timestamp2`.",
+ usage = """
+ _FUNC_(timestamp1, timestamp2) - If `timestamp` is later than `timestamp2`, then the result
+ is positive. If `timestamp1` and `timestamp2` are on the same day of month, or both
+ are the last day of month, time of day will be ignored. Otherwise, the
+ difference is calculated based on 31 days per month, and rounded to 8 digits.
+ """,
--- End diff --
I am not sure why you don't like this format:
```
usage = """
_FUNC_(timestamp1, timestamp2) - If `timestamp` is later than `timestamp2`, then the result
is positive. If `timestamp1` and `timestamp2` are on the same day of month, or both
are the last day of month, time of day will be ignored. Otherwise, the difference is
calculated based on 31 days per month, and rounded to 8 digits.
""",
```
It's actually consistent with other ones such as:
https://github.com/apache/spark/blob/df7fc3ef3899cadd252d2837092bebe3442d6523/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproximatePercentile.scala#L51-L60
not a big deal but it should be good to match while we are here.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r186467842
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1194,13 +1194,21 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
}
/**
- * Returns number of months between dates date1 and date2.
+ * Returns number of months between dates `date1` and `date2`.
+ * If `date1` is later than `date2`, then the result is positive.
+ * If `date1` and `date2` are on the same day of month, or both
+ * are the last day of month, time of day will be ignored. Otherwise, the
+ * difference is calculated based on 31 days per month, and rounded to
+ * 8 digits unless roundOff=false.
*/
// scalastyle:off line.size.limit
@ExpressionDescription(
usage = """
- _FUNC_(timestamp1, timestamp2[, roundOff]) - Returns number of months between `timestamp1` and `timestamp2`.
- The result is rounded to 8 decimal places by default. Set roundOff=false otherwise."""",
+ _FUNC_(date1, date2[, roundOff]) - If `date1` is later than `date2`, then the result
--- End diff --
Yea, I got that they are consistent now but actually I think timestamp is more correct since the actual expected types here are timestmaps, not dates. Let's just leave them as were alone. It had a long review iterations.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: Documenting months_between direction
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r175983804
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala ---
@@ -881,10 +881,10 @@ object DateTimeUtils {
* Returns number of months between time1 and time2. time1 and time2 are expressed in
* microseconds since 1.1.1970.
*
- * If time1 and time2 having the same day of month, or both are the last day of month,
- * it returns an integer (time under a day will be ignored).
+ * If time1 and time2 are on the same day of month, or both are the last day of month,
+ * returns an integer (time under a day will be ignored).
--- End diff --
It seems a bit awkward because it actually returns a double. Shall we fix this like .. `returns an integer (time under a day will be ignored)` -> `time under a day will be ignored.`?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by aditkumar <gi...@git.apache.org>.
Github user aditkumar commented on the issue:
https://github.com/apache/spark/pull/20787
@HyukjinKwon I think these address your comments.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #4152 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/4152/testReport)** for PR 20787 at commit [`913eed8`](https://github.com/apache/spark/commit/913eed849d218a34d6e28a2500301320ba21cecc).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88421 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88421/testReport)** for PR 20787 at commit [`9d99121`](https://github.com/apache/spark/commit/9d991212cb4da219257964b0d20aaf57a194e558).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r177662053
--- Diff: R/pkg/R/functions.R ---
@@ -1958,6 +1958,7 @@ setMethod("levenshtein", signature(y = "Column"),
})
#' @details
+#'
--- End diff --
I don't think that's what I meant?
`#'` on a newline after ` 8 digits. `
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88523/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90151 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90151/testReport)** for PR 20787 at commit [`208830e`](https://github.com/apache/spark/commit/208830e6592c3fc087faf5a55e1ebfb7c3493a81).
* This patch **fails to build**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90153 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90153/testReport)** for PR 20787 at commit [`31a126f`](https://github.com/apache/spark/commit/31a126f4a6d3be102503639c6d09419a962e1f98).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r186277140
--- Diff: R/pkg/R/functions.R ---
@@ -1906,6 +1906,7 @@ setMethod("atan2", signature(y = "Column"),
#' @details
#' \code{datediff}: Returns the number of days from \code{y} to \code{x}.
+#' If \code{y} is later than \code{x} then the result is positive.
--- End diff --
I'd add the same sentence to Python and Scala side too.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88520/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r186458260
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1194,13 +1194,21 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
}
/**
- * Returns number of months between dates date1 and date2.
+ * Returns number of months between dates `date1` and `date2`.
+ * If `date1` is later than `date2`, then the result is positive.
+ * If `date1` and `date2` are on the same day of month, or both
+ * are the last day of month, time of day will be ignored. Otherwise, the
+ * difference is calculated based on 31 days per month, and rounded to
+ * 8 digits unless roundOff=false.
*/
// scalastyle:off line.size.limit
@ExpressionDescription(
usage = """
- _FUNC_(timestamp1, timestamp2[, roundOff]) - Returns number of months between `timestamp1` and `timestamp2`.
- The result is rounded to 8 decimal places by default. Set roundOff=false otherwise."""",
+ _FUNC_(date1, date2[, roundOff]) - If `date1` is later than `date2`, then the result
--- End diff --
Last comment. Let's just leave `timestamp1` and `timestamp2` as were in the `usage` specifically..
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90205 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90205/testReport)** for PR 20787 at commit [`22e9435`](https://github.com/apache/spark/commit/22e943574e718667629588cc0a236f8952d088c7).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:
https://github.com/apache/spark/pull/20787
retest this please
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #89634 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/89634/testReport)** for PR 20787 at commit [`e30473d`](https://github.com/apache/spark/commit/e30473dcca87292c6aa6bb78920d7bcaadd636fe).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88639 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88639/testReport)** for PR 20787 at commit [`5d01c35`](https://github.com/apache/spark/commit/5d01c35aa20fe4173e513e2485a04e33f981ec77).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: Documenting months_between direction
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r173619271
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/functions.scala ---
@@ -2708,7 +2708,8 @@ object functions {
def minute(e: Column): Column = withExpr { Minute(e.expr) }
/**
- * Returns number of months between dates `date1` and `date2`.
+ * Returns number of months between dates `date1` and `date2`. If `date1` is later than `date2`,
+ * then the result is positive.
--- End diff --
Can we resemble this:
https://github.com/apache/spark/blob/6e36d8d56279a2c5c92c8df8e89ee99b514817e7/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala#L884-L888
?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by aditkumar <gi...@git.apache.org>.
Github user aditkumar commented on the issue:
https://github.com/apache/spark/pull/20787
Not at all
On Thu, May 3, 2018 at 9:30 PM Hyukjin Kwon <no...@github.com>
wrote:
> *@HyukjinKwon* commented on this pull request.
> ------------------------------
>
> In
> sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
> <https://github.com/apache/spark/pull/20787#discussion_r185976200>:
>
> > @@ -887,11 +887,25 @@ object DateTimeUtils {
> * Returns number of months between time1 and time2. time1 and time2 are expressed in
> * microseconds since 1.1.1970.
> *
> - * If time1 and time2 having the same day of month, or both are the last day of month,
> - * it returns an integer (time under a day will be ignored).
> + * If time1 and time2 are on the same day of month, or both are the last day of month,
> + * time of a day will be ignored.
> + *
> + * Otherwise, the difference is calculated based on 31 days per month, and rounded to
> + * 8 digits.
> + */
> + def monthsBetween(time1: SQLTimestamp, time2: SQLTimestamp): Double = {
>
> From a very quick look. there was a mistake when merging it in. @aditkumar
> <https://github.com/aditkumar>, mind if I ask to rebase and sync it
> please?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/spark/pull/20787#pullrequestreview-117477421>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABee_84UZDHyqyEmNtyYe_MuC2i4Ee1lks5tu688gaJpZM4SkgK->
> .
>
--
Adit Kumar (US) +1 (201)-566-8630 (UK) +44 7415 930329 Sent via mobile
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/89635/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Can one of the admins verify this patch?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88641 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88641/testReport)** for PR 20787 at commit [`ed369ff`](https://github.com/apache/spark/commit/ed369fff82eeaf2fc66e73b001cd2975d25a95b0).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/90204/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88641/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r177663453
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1117,11 +1117,22 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
}
/**
- * Returns number of months between dates date1 and date2.
+ * Returns number of months between dates `timestamp1` and `timestamp2`.
+ * If `timestamp` is later than `timestamp2`, then the result is positive.
+ * If `timestamp1` and `timestamp2` are on the same day of month, or both
+ * are the last day of month, time of day will be ignored. Otherwise, the
+ * difference is calculated based on 31 days per month, and rounded to
+ * 8 digits.
*/
// scalastyle:off line.size.limit
@ExpressionDescription(
- usage = "_FUNC_(timestamp1, timestamp2) - Returns number of months between `timestamp1` and `timestamp2`.",
+ usage = """
+ _FUNC_(timestamp1, timestamp2) -
+ If `timestamp` is later than `timestamp2`, then the result is positive.
+ If `timestamp1` and `timestamp2` are on the same day of month, or both
+ are the last day of month, time of day will be ignored. Otherwise, the
+ difference is calculated based on 31 days per month, and rounded to 8 digits.
+ """,
--- End diff --
Seems different from what I suggested at https://github.com/apache/spark/pull/20787#discussion_r176949408 ..
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88419 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88419/testReport)** for PR 20787 at commit [`9afb314`](https://github.com/apache/spark/commit/9afb3140469f801d1f08c5b30e0698ec524fcc92).
* This patch **fails Scala style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88522 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88522/testReport)** for PR 20787 at commit [`0b11544`](https://github.com/apache/spark/commit/0b115442576dc53db7452681d7b2ec152a3ee7da).
* This patch **fails Scala style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88423 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88423/testReport)** for PR 20787 at commit [`682bc8c`](https://github.com/apache/spark/commit/682bc8cd766c405d241bf76af62ab03ac3cc26d2).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/89634/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/90150/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90153 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90153/testReport)** for PR 20787 at commit [`31a126f`](https://github.com/apache/spark/commit/31a126f4a6d3be102503639c6d09419a962e1f98).
* This patch **fails to build**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88524 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88524/testReport)** for PR 20787 at commit [`292508d`](https://github.com/apache/spark/commit/292508deed398b318bb26d6df3c2133319634b1d).
* This patch **fails Scala style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/90151/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #89634 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/89634/testReport)** for PR 20787 at commit [`e30473d`](https://github.com/apache/spark/commit/e30473dcca87292c6aa6bb78920d7bcaadd636fe).
* This patch **fails Scala style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88641 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88641/testReport)** for PR 20787 at commit [`ed369ff`](https://github.com/apache/spark/commit/ed369fff82eeaf2fc66e73b001cd2975d25a95b0).
* This patch **fails Scala style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: Documenting months_between direction
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r175983334
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1115,13 +1115,17 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
override def prettyName: String = "add_months"
}
-
--- End diff --
Let's revert this change back. Seems unrelated.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r176925831
--- Diff: R/pkg/R/functions.R ---
@@ -1957,8 +1958,12 @@ setMethod("levenshtein", signature(y = "Column"),
})
#' @details
-#' \code{months_between}: Returns number of months between dates \code{y} and \code{x}.
-#'
+#' \code{months_between}: Returns number of months between dates \code{y} and \code{x}.
+#' If \code{y} is later than \code{x}, then the result is positive.
+#' If \code{y} and \code{x} are on the same day of month, or both are the last day of month,
+#' time of day will be ignored.
+#' Otherwise, the difference is calculated based on 31 days per month, and rounded to
+#' 8 digits.
#' @rdname column_datetime_diff_functions
--- End diff --
you should leave a line `#'` before this
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by aditkumar <gi...@git.apache.org>.
Github user aditkumar commented on the issue:
https://github.com/apache/spark/pull/20787
@HyukjinKwon I don't have an objection, but it's not clear to me what the difference was. Committed with your version.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88523 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88523/testReport)** for PR 20787 at commit [`ef43d7b`](https://github.com/apache/spark/commit/ef43d7b747e5252af1f91e74e0b4e9c4cefef598).
* This patch **fails Scala style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88423/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90150 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90150/testReport)** for PR 20787 at commit [`737aa02`](https://github.com/apache/spark/commit/737aa0231654073ac42b02b26474d1a3ace76706).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r185976200
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala ---
@@ -887,11 +887,25 @@ object DateTimeUtils {
* Returns number of months between time1 and time2. time1 and time2 are expressed in
* microseconds since 1.1.1970.
*
- * If time1 and time2 having the same day of month, or both are the last day of month,
- * it returns an integer (time under a day will be ignored).
+ * If time1 and time2 are on the same day of month, or both are the last day of month,
+ * time of a day will be ignored.
+ *
+ * Otherwise, the difference is calculated based on 31 days per month, and rounded to
+ * 8 digits.
+ */
+ def monthsBetween(time1: SQLTimestamp, time2: SQLTimestamp): Double = {
--- End diff --
From a very quick look. there was a mistake when merging it in. @aditkumar, mind if I ask to rebase and sync it please?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: Documenting months_between direction
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r175982564
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1115,13 +1115,17 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
override def prettyName: String = "add_months"
}
-
/**
- * Returns number of months between dates date1 and date2.
- */
+ * Returns number of months between dates `timestamp1` and `timestamp2`.
--- End diff --
Hm, this should have been caught by Scala linter because we follow Java style comment. See "Code documentation style" in http://spark.apache.org/contributing.html
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90150 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90150/testReport)** for PR 20787 at commit [`737aa02`](https://github.com/apache/spark/commit/737aa0231654073ac42b02b26474d1a3ace76706).
* This patch **fails PySpark unit tests**.
* This patch **does not merge cleanly**.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90321 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90321/testReport)** for PR 20787 at commit [`6a3ba4a`](https://github.com/apache/spark/commit/6a3ba4af43072b2e135855e1c04f6b2987cd94aa).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88520 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88520/testReport)** for PR 20787 at commit [`56b699f`](https://github.com/apache/spark/commit/56b699f7a8eb805d734919f4f8c4b08b32b55ff0).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: Documenting months_between direction
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r175985253
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1115,13 +1115,17 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
override def prettyName: String = "add_months"
}
-
/**
- * Returns number of months between dates date1 and date2.
- */
+ * Returns number of months between dates `timestamp1` and `timestamp2`.
+ * If `timestamp` is later than `timestamp2`, then the result is positive.
+ * If `timestamp1` and `timestamp2` are on the same day of month, or both
+ * are the last day of month, returns an integer (time of day will be ignored).
+ * Otherwise, the difference is calculated based on 31 days per month, and
+ * rounded to 8 digits.
+*/
// scalastyle:off line.size.limit
@ExpressionDescription(
- usage = "_FUNC_(timestamp1, timestamp2) - Returns number of months between `timestamp1` and `timestamp2`.",
+ usage = "_FUNC_(timestamp1, timestamp2) - Returns number of months between `timestamp1` and `timestamp2`. Positive if `timestamp1` is later than `timestamp2`",
--- End diff --
You could do either
```scala
@ExpressionDescription(
usage = """
_FUNC_(timestamp1, timestamp2) - blablabla
blabla
blabla
""",
...
```
Let's add the description here too.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88639/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #89419 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/89419/testReport)** for PR 20787 at commit [`3ca9948`](https://github.com/apache/spark/commit/3ca99489a1a88d16f371091e86e4a58962e00759).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Can one of the admins verify this patch?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #90205 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/90205/testReport)** for PR 20787 at commit [`22e9435`](https://github.com/apache/spark/commit/22e943574e718667629588cc0a236f8952d088c7).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/90205/
Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #4152 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/4152/testReport)** for PR 20787 at commit [`913eed8`](https://github.com/apache/spark/commit/913eed849d218a34d6e28a2500301320ba21cecc).
* This patch **fails Spark unit tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88421/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88524 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88524/testReport)** for PR 20787 at commit [`292508d`](https://github.com/apache/spark/commit/292508deed398b318bb26d6df3c2133319634b1d).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88421 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88421/testReport)** for PR 20787 at commit [`9d99121`](https://github.com/apache/spark/commit/9d991212cb4da219257964b0d20aaf57a194e558).
* This patch **fails Python style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r176925842
--- Diff: R/pkg/R/functions.R ---
@@ -1957,8 +1958,12 @@ setMethod("levenshtein", signature(y = "Column"),
})
#' @details
-#' \code{months_between}: Returns number of months between dates \code{y} and \code{x}.
-#'
+#' \code{months_between}: Returns number of months between dates \code{y} and \code{x}.
+#' If \code{y} is later than \code{x}, then the result is positive.
+#' If \code{y} and \code{x} are on the same day of month, or both are the last day of month,
+#' time of day will be ignored.
+#' Otherwise, the difference is calculated based on 31 days per month, and rounded to
+#' 8 digits.
#' @rdname column_datetime_diff_functions
--- End diff --
also just as reference, the whitespace/newline will be stripped
```
time of day will be ignored.
Otherwise
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r176949408
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1117,11 +1117,23 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
}
/**
- * Returns number of months between dates date1 and date2.
+ * Returns number of months between dates `timestamp1` and `timestamp2`.
+ * If `timestamp` is later than `timestamp2`, then the result is positive.
+ * If `timestamp1` and `timestamp2` are on the same day of month, or both
+ * are the last day of month, time of day will be ignored.
+ * Otherwise, the difference is calculated based on 31 days per month, and
+ * rounded to 8 digits.
*/
// scalastyle:off line.size.limit
@ExpressionDescription(
- usage = "_FUNC_(timestamp1, timestamp2) - Returns number of months between `timestamp1` and `timestamp2`.",
+ usage = """
+ _FUNC_(timestamp1, timestamp2) -
+ If `timestamp` is later than `timestamp2`, then the result is positive.
+ If `timestamp1` and `timestamp2` are on the same day of month, or both
+ are the last day of month, time of day will be ignored.
+ Otherwise, the difference is calculated based on 31 days per month, and
+ rounded to 8 digits.
+ """,
--- End diff --
```scala
usage = """
_FUNC_(timestamp1, timestamp2) - If `timestamp` is later than `timestamp2`, then the result
is positive. If `timestamp1` and `timestamp2` are on the same day of month, or both
are the last day of month, time of day will be ignored. Otherwise, the difference is
calculated based on 31 days per month, and rounded to 8 digits.
""",
```
Let's keep the format consistent.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88524/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test PASSed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:
https://github.com/apache/spark/pull/20787
Merged to master
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/90167/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r176946746
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1117,11 +1117,23 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
}
/**
- * Returns number of months between dates date1 and date2.
+ * Returns number of months between dates `timestamp1` and `timestamp2`.
+ * If `timestamp` is later than `timestamp2`, then the result is positive.
+ * If `timestamp1` and `timestamp2` are on the same day of month, or both
+ * are the last day of month, time of day will be ignored.
+ * Otherwise, the difference is calculated based on 31 days per month, and
+ * rounded to 8 digits.
--- End diff --
Thanks for improving our doc!
Could you also add the related tests in our test suite? https://github.com/apache/spark/blob/master/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala#L488-L511
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/88419/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:
https://github.com/apache/spark/pull/20787
Seems fine otherwise.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: [MINOR][DOCS] Documenting months_between direction
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/20787
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r183221673
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1117,11 +1117,21 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
}
/**
- * Returns number of months between dates date1 and date2.
+ * Returns number of months between dates `timestamp1` and `timestamp2`.
+ * If `timestamp` is later than `timestamp2`, then the result is positive.
--- End diff --
Nit: timestamp -> timestamp1. Same below.
Nit: These are called date1 and date2 in Python, and also here in the Scala code. Worth being consistent?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #20787: [MINOR][DOCS] Documenting months_between directio...
Posted by aditkumar <gi...@git.apache.org>.
Github user aditkumar commented on a diff in the pull request:
https://github.com/apache/spark/pull/20787#discussion_r186464442
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala ---
@@ -1194,13 +1194,21 @@ case class AddMonths(startDate: Expression, numMonths: Expression)
}
/**
- * Returns number of months between dates date1 and date2.
+ * Returns number of months between dates `date1` and `date2`.
+ * If `date1` is later than `date2`, then the result is positive.
+ * If `date1` and `date2` are on the same day of month, or both
+ * are the last day of month, time of day will be ignored. Otherwise, the
+ * difference is calculated based on 31 days per month, and rounded to
+ * 8 digits unless roundOff=false.
*/
// scalastyle:off line.size.limit
@ExpressionDescription(
usage = """
- _FUNC_(timestamp1, timestamp2[, roundOff]) - Returns number of months between `timestamp1` and `timestamp2`.
- The result is rounded to 8 decimal places by default. Set roundOff=false otherwise."""",
+ _FUNC_(date1, date2[, roundOff]) - If `date1` is later than `date2`, then the result
--- End diff --
I'm going to leave it as date1, date2 because that also lines up with the variable names in the function definition.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88407 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88407/testReport)** for PR 20787 at commit [`2de6aca`](https://github.com/apache/spark/commit/2de6acacbecdbc6a65cc956c682ae8a3ff4175d2).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88423 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88423/testReport)** for PR 20787 at commit [`682bc8c`](https://github.com/apache/spark/commit/682bc8cd766c405d241bf76af62ab03ac3cc26d2).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #20787: Documenting months_between direction
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/20787
**[Test build #88420 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/88420/testReport)** for PR 20787 at commit [`264ed99`](https://github.com/apache/spark/commit/264ed994e2b74239907fdccc40544ca67d9b0531).
* This patch **fails Python style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org