-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29723][SQL] Get date and time parts of an interval as java classes #26368
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
|
@cloud-fan @hvanhovell Please, take a look at this. If it makes sense for you, we could discuss alternative names for methods like |
|
Test build #113129 has finished for PR 26368 at commit
|
|
jenkins, retest this, please |
|
Test build #113156 has finished for PR 26368 at commit
|
|
how about |
…va-period-duration # Conflicts: # common/unsafe/src/main/java/org/apache/spark/unsafe/types/CalendarInterval.java
|
Test build #113199 has finished for PR 26368 at commit
|
dongjoon-hyun
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.
+1, LGTM. Thank you, @MaxGekk and @cloud-fan .
Merged to master.
What changes were proposed in this pull request?
I propose 2 new methods for
CalendarInterval:extractAsPeriod()returns the date part of an interval as an instance ofjava.time.PeriodextractAsDuration()returns the time part of an interval as an instance ofjava.time.DurationFor example:
Why are the changes needed?
Taking into account that
CalendarIntervalhas been already partially exposed to users via the collect operation, and probably it will be fully exposed in the future, it could be convenient for users to get the date and time parts of intervals as java classes:Does this PR introduce any user-facing change?
No
How was this patch tested?
By new test in
CalendarIntervalSuite.