-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
ARROW-3923: [Java] JDBC Time Fetches Without Timezone #3066
Conversation
@jacques-n @siddharthteotia @BryanCutler Can you have a look a this? |
Hi, I just posted #3133 which adds a configuration class to the conversion process. If you want, I can incorporate that change here, to make this a non-breaking change. |
Bring master up to date.
I'm not too familiar with this module, let's ping the original author @atuldambalkar and @laurentgo to possibly take a look |
@siddharthteotia @laurentgo @atuldambalkar can you review? |
Week Ending 12/15
I'll try to give a review asap, but there some danger on relying on the default timezone, especially as Arrow is fairly explicit about timezones (that said, haven't fully reviewed it yet, so might be have addressed...) |
Thanks @laurentgo for taking a look! I was looking through the Arrow code and it looks like there are various variations on timestamp types, and not all of them require a time zone. The current code forces everything to UTC if a time zone isn't provided, which didn't seem right to me, because the database field itself may not have a time zone attached to it. Likewise, it didn't seem right to enforce a time zone when Arrow didn't appear to need one. |
12/30/18 Pulldown
Hi @mikepigott |
Hi, 3966 supercedes 3965, but this one is independent - if this PR was rejected, I didn't want to impact those two. Thanks for taking a look! |
Hi @mikepigott - I looked at JDBC ResultSet API and I tend to agree with your changes and use the Calendar object if explicitly provided by the caller. Basically, in case of non-availability of Calendar object from the caller, we will be falling back to the way JDBC ResultSet API implements Date/Time related API. Hi @laurentgo - What's your opinion? |
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.
would this be backward incompatible? previously UTC would have been used and not the local calendar..
@praveenbingo - yes, you are right, this is a backwards-incompatible change. I have a separate PR, #3965 that introduces a configuration object. If that PR is approved before this one, I'm happy to rework this PR to use the configuration object and prevent this from being backwards-incompatible. |
Arrow Master 1/29/2019
@mikepigott - Done. Please go ahead with your suggestion. Thanks. |
Sounds good @praveenbingo @mikepigott . I will take a look at PR 3966. |
Arrow Master on 2/3
@praveenbingo: I have pulled in the |
Codecov Report
@@ Coverage Diff @@
## master #3066 +/- ##
==========================================
+ Coverage 87.77% 88.55% +0.77%
==========================================
Files 659 434 -225
Lines 82110 53263 -28847
Branches 1069 0 -1069
==========================================
- Hits 72076 47165 -24911
+ Misses 9923 6098 -3825
+ Partials 111 0 -111
Continue to review full report at Codecov.
|
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.
looks good. Thanks @mikepigott
@wesm @siddharthteotia - Could you please help merging.
@siddharthdave If there are no objections from your side, I'll merge this tomorrow. |
@xhochy , you probably meant @siddharthteotia :-) |
Thank you @mikepigott ! |
https://issues.apache.org/jira/browse/ARROW-3923 Hello! I was reading through the JDBC source code and I noticed that a java.util.Calendar was required for creating an Arrow Schema and Arrow Vectors from a JDBC ResultSet, when none is required. This change makes the Calendar optional. Unit Tests: The existing SureFire plugin configuration uses a UTC calendar for the database, which is the default Calendar in the existing code. Likewise, no changes to the unit tests are required to provide adequate coverage for the change. Author: Michael Pigott <mikepigott@users.noreply.github.com> Author: Mike Pigott <mpigott@gmail.com> Closes #3066 from mikepigott/jdbc-timestamp-no-calendar and squashes the following commits: 4d95da0 <Mike Pigott> ARROW-3923: Supporting a null Calendar in the config, and reverting the breaking change. cd9a230 <Mike Pigott> Merge branch 'master' into jdbc-timestamp-no-calendar 509a1cc <Michael Pigott> Merge pull request #5 from apache/master 789c8c8 <Michael Pigott> Merge pull request #4 from apache/master e5b19ee <Michael Pigott> Merge pull request #3 from apache/master 3b17c29 <Michael Pigott> Merge pull request #2 from apache/master 881c6c8 <Michael Pigott> Merge pull request #1 from apache/master 089cff4 <Mike Pigott> Format fixes a58a4a5 <Mike Pigott> Fixing calendar usage. e12832a <Mike Pigott> Allowing for timestamps without a time zone.
https://issues.apache.org/jira/browse/ARROW-3923
Hello! I was reading through the JDBC source code and I noticed that a java.util.Calendar was required for creating an Arrow Schema and Arrow Vectors from a JDBC ResultSet, when none is required.
This change makes the Calendar optional.
Unit Tests:
The existing SureFire plugin configuration uses a UTC calendar for the database, which is the default Calendar in the existing code. Likewise, no changes to the unit tests are required to provide adequate coverage for the change.