You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/04/09 10:25:05 UTC
[GitHub] [spark] cloud-fan opened a new pull request #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
cloud-fan opened a new pull request #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
improve the code comment and make them consistent between `rebaseJulianToGregorian*` and `rebaseGregorianToJulian*`
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
improve readability.
### Does this PR introduce any user-facing change?
<!--
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If no, write 'No'.
-->
no
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
-->
N/A
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611563717
**[Test build #121035 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121035/testReport)** for PR 28166 at commit [`2e8fac4`](https://github.com/apache/spark/commit/2e8fac47be5a2e546c06adbf08d6bbb20cd817bb).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#discussion_r406108658
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/RebaseDateTime.scala
##########
@@ -97,51 +105,26 @@ object RebaseDateTime {
-390750, -354226, -317702, -244653, -208129, -171605, -141427)
/**
- * Rebasing days since the epoch to store the same number of days
- * as by Spark 2.4 and earlier versions. Spark 3.0 switched to
- * Proleptic Gregorian calendar (see SPARK-26651), and as a consequence of that,
- * this affects dates before 1582-10-15. Spark 2.4 and earlier versions use
- * Julian calendar for dates before 1582-10-15. So, the same local date may
- * be mapped to different number of days since the epoch in different calendars.
+ * Converts the given number of days since the epoch day 1970-01-01 to a local date in Proleptic
+ * Gregorian calendar, interprets the result as a local date in Julian calendar, and take the
+ * number of days since the epoch from the Julian local date.
+ *
+ * This is used to guarantee backward compatibility, as Spark 2.4 and earlier versions use
+ * Julian calendar for dates before 1582-10-15, while Spark 3.0 and later use Proleptic Gregorian
+ * calendar. See SPARK-26651.
*
* For example:
* Proleptic Gregorian calendar: 1582-01-01 -> -141714
* Julian calendar: 1582-01-01 -> -141704
* The code below converts -141714 to -141704.
*
- * @param days The number of days since the epoch 1970-01-01. It can be negative.
+ * @param days The number of days since the epoch in Gregorian calendar. It can be negative.
* @return The rebased number of days since the epoch in Julian calendar.
*/
def rebaseGregorianToJulianDays(days: Int): Int = {
rebaseDays(gregJulianDiffSwitchDay, gregJulianDiffs, days)
}
- /**
- * Converts the given microseconds to a local date-time in UTC time zone in Proleptic Gregorian
- * calendar, interprets the result as a local date-time in Julian calendar in UTC time zone.
- * And takes microseconds since the epoch from the Julian timestamp.
- *
- * @param zoneId The time zone ID at which the rebasing should be performed.
- * @param micros The number of microseconds since the epoch '1970-01-01T00:00:00Z'
- * in Proleptic Gregorian calendar. It can be negative.
- * @return The rebased microseconds since the epoch in Julian calendar.
- */
- private[sql] def rebaseGregorianToJulianMicros(zoneId: ZoneId, micros: Long): Long = {
Review comment:
move it closer to its optimized version.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611456078
**[Test build #121027 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121027/testReport)** for PR 28166 at commit [`7a578de`](https://github.com/apache/spark/commit/7a578de2fcdf17ace2230957ab19186303aaea3f).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611456591
Merged build finished. Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan closed pull request #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611456596
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/25718/
Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611592826
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/121027/
Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611591766
**[Test build #121027 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121027/testReport)** for PR 28166 at commit [`7a578de`](https://github.com/apache/spark/commit/7a578de2fcdf17ace2230957ab19186303aaea3f).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611453299
cc @MaxGekk @HyukjinKwon
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611456078
**[Test build #121027 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121027/testReport)** for PR 28166 at commit [`7a578de`](https://github.com/apache/spark/commit/7a578de2fcdf17ace2230957ab19186303aaea3f).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611564532
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/25726/
Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611592812
Merged build finished. Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on a change in pull request #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#discussion_r406215016
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/RebaseDateTime.scala
##########
@@ -97,51 +105,26 @@ object RebaseDateTime {
-390750, -354226, -317702, -244653, -208129, -171605, -141427)
/**
- * Rebasing days since the epoch to store the same number of days
- * as by Spark 2.4 and earlier versions. Spark 3.0 switched to
- * Proleptic Gregorian calendar (see SPARK-26651), and as a consequence of that,
- * this affects dates before 1582-10-15. Spark 2.4 and earlier versions use
- * Julian calendar for dates before 1582-10-15. So, the same local date may
- * be mapped to different number of days since the epoch in different calendars.
+ * Converts the given number of days since the epoch day 1970-01-01 to a local date in Proleptic
+ * Gregorian calendar, interprets the result as a local date in Julian calendar, and take the
Review comment:
and take -> and takes
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611713886
Merged build finished. Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611713886
Merged build finished. Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611713895
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/121035/
Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611863318
thanks, merging to master/3.0
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611592812
Merged build finished. Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#discussion_r406136677
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/RebaseDateTime.scala
##########
@@ -256,14 +270,23 @@ object RebaseDateTime {
}
/**
- * Converts the given microseconds to a local date-time in UTC time zone in the hybrid
- * calendar (Julian + Gregorian since 1582-10-15), interprets the result as a local date-time
- * in Proleptic Gregorian calendar in UTC time zone. And takes microseconds since the epoch
- * from the Gregorian timestamp.
+ * Converts the given number of microseconds since the epoch '1970-01-01T00:00:00Z', to a local
+ * date-time in Julian calendar with timezone identified by `zoneId`, interprets the result as a
+ * local date-time in Proleptic Gregorian calendar with the same timezone, and takes microseconds
+ * since the epoch from the Gregorian local date-time.
+ *
+ * This is used to guarantee backward compatibility, as Spark 2.4 and earlier versions use
+ * Julian calendar for dates before 1582-10-15, while Spark 3.0 and later use Proleptic Gregorian
+ * calendar. See SPARK-26651.
+ *
+ * For example:
+ * Julian calendar: 1582-01-01 00:00:00.123456 -> -12243196799876544
+ * Proleptic Gregorian calendar: 1582-01-01 00:00:00.123456 -> -12244061221876544
+ * The code below converts -12243196799876544 to -12244061221876544.
*
* @param zoneId The time zone ID at which the rebasing should be performed.
* @param micros The number of microseconds since the epoch '1970-01-01T00:00:00Z'
- * in the hybrid calendar (Julian + Gregorian). It can be negative.
+ * in the Julian calendar. It can be negative.
Review comment:
The rebase mostly happens before 1582, so Julian calenday is OK. The method name is also `JulianToGregorian`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611564518
Merged build finished. Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611713022
**[Test build #121035 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121035/testReport)** for PR 28166 at commit [`2e8fac4`](https://github.com/apache/spark/commit/2e8fac47be5a2e546c06adbf08d6bbb20cd817bb).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611456591
Merged build finished. Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611592826
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/121027/
Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] MaxGekk commented on a change in pull request #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#discussion_r406113259
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/RebaseDateTime.scala
##########
@@ -256,14 +270,23 @@ object RebaseDateTime {
}
/**
- * Converts the given microseconds to a local date-time in UTC time zone in the hybrid
- * calendar (Julian + Gregorian since 1582-10-15), interprets the result as a local date-time
- * in Proleptic Gregorian calendar in UTC time zone. And takes microseconds since the epoch
- * from the Gregorian timestamp.
+ * Converts the given number of microseconds since the epoch '1970-01-01T00:00:00Z', to a local
+ * date-time in Julian calendar with timezone identified by `zoneId`, interprets the result as a
+ * local date-time in Proleptic Gregorian calendar with the same timezone, and takes microseconds
+ * since the epoch from the Gregorian local date-time.
+ *
+ * This is used to guarantee backward compatibility, as Spark 2.4 and earlier versions use
+ * Julian calendar for dates before 1582-10-15, while Spark 3.0 and later use Proleptic Gregorian
+ * calendar. See SPARK-26651.
+ *
+ * For example:
+ * Julian calendar: 1582-01-01 00:00:00.123456 -> -12243196799876544
+ * Proleptic Gregorian calendar: 1582-01-01 00:00:00.123456 -> -12244061221876544
+ * The code below converts -12243196799876544 to -12244061221876544.
*
* @param zoneId The time zone ID at which the rebasing should be performed.
* @param micros The number of microseconds since the epoch '1970-01-01T00:00:00Z'
- * in the hybrid calendar (Julian + Gregorian). It can be negative.
+ * in the Julian calendar. It can be negative.
Review comment:
Technically, it is the hybrid calendar because Julian calendar doesn't stop at 1582-10-15. Java 7. GregorianCalendar just switches internally between 2 calendars.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611564532
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/25726/
Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611563717
**[Test build #121035 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/121035/testReport)** for PR 28166 at commit [`2e8fac4`](https://github.com/apache/spark/commit/2e8fac47be5a2e546c06adbf08d6bbb20cd817bb).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611456596
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/25718/
Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611713895
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/121035/
Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on issue #28166:
[SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #28166: [SPARK-31359][DOC][followup] improve code comments in RebaseDateTime
URL: https://github.com/apache/spark/pull/28166#issuecomment-611564518
Merged build finished. Test PASSed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org