-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-31984][SQL] Make micros rebasing functions via local timestamps pure #28824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #123982 has finished for PR 28824 at commit
|
|
@cloud-fan @HyukjinKwon Please, review this PR. |
HyukjinKwon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…-rebasing # Conflicts: # sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/RebaseDateTimeSuite.scala
|
Test build #124061 has finished for PR 28824 at commit
|
…-rebasing # Conflicts: # sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/RebaseDateTime.scala
| // Check reverse rebasing | ||
| assert(rebaseJulianToGregorianMicros(rebasedEarlierMicros) === earlierMicros) | ||
| assert(rebaseJulianToGregorianMicros(rebasedLaterMicros) === laterMicros) | ||
| // Check reverse not-optimized rebasing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this rely on JVM timezone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, they don't. Let me move them out of the default JVM time zone. Thanks.
|
Test build #124103 has finished for PR 28824 at commit
|
|
Test build #124105 has finished for PR 28824 at commit
|
|
thanks, merging to master! |
What changes were proposed in this pull request?
RebaseDateTime.rebaseJulianToGregorianMicros()andrebaseGregorianToJulianMicros()to Java 7GregorianCalendar.This makes the instance of the calendar independent from the default JVM time zone.
ZoneIdtoTimeZone. This allows to avoid unnecessary conversion fromTimeZonetoZoneId, for example inand back to
TimeZoneinside ofrebaseJulianToGregorianMicros(zoneId: ZoneId, ...)RebaseDateTimeSuite, and set the default JVM time zone only for functions that depend on it.Why are the changes needed?
gregorian-julian-rebase-micros.jsonandjulian-gregorian-rebase-micros.json. Currently, the testsgenerate 'gregorian-julian-rebase-micros.json'andgenerate 'julian-gregorian-rebase-micros.json'generate the JSON files by iterating over all time zones sequentially w/ step of 1 week. Due to the large step, we can miss some spikes in diffs between 2 calendars (Java 8 Gregorian and Java 7 hybrid calendars) as the PR [SPARK-31959][SQL][test-java11] Fix Gregorian-Julian micros rebasing while switching standard time zone offset #28787 fixed and [SPARK-31986][SQL] Fix Julian-Gregorian micros rebasing of overlapping local timestamps #28816 should fix.Does this PR introduce any user-facing change?
No
How was this patch tested?
By running existing tests from
RebaseDateTimeSuite.