-
Notifications
You must be signed in to change notification settings - Fork 919
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
JDBC driver implements getDate, getTimestamp and getTime with Calendar in ResultSet #5752
Conversation
@pan3793 plz review this feature. Thanks! |
@@ -198,6 +199,32 @@ public Date getDate(String columnName) throws SQLException { | |||
return getDate(findColumn(columnName)); | |||
} | |||
|
|||
public Date getDate(int columnIndex, Calendar cal) throws SQLException { |
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.
please add @Overwrite
, and can we remove it from the parent abstract class?
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5752 +/- ##
============================================
- Coverage 61.44% 61.22% -0.22%
Complexity 23 23
============================================
Files 607 607
Lines 35897 36030 +133
Branches 4923 4948 +25
============================================
+ Hits 22058 22061 +3
- Misses 11461 11571 +110
- Partials 2378 2398 +20 ☔ View full report in Codecov by Sentry. |
would you mind adding UTs within |
|
added. plz review. Thanks. |
cc @cxzl25 |
assert(resultSet.next()) | ||
assert(resultSet.getTimestamp( | ||
"col", | ||
Calendar.getInstance(TimeZone.getTimeZone("UTC"))) === Timestamp.valueOf( |
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.
what if the TimeZone is not UTC?
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.
Let me check it.
kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiBaseResultSet.java
Outdated
Show resolved
Hide resolved
kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiBaseResultSet.java
Outdated
Show resolved
Hide resolved
kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiBaseResultSet.java
Outdated
Show resolved
Hide resolved
kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiArrowBasedResultSet.java
Outdated
Show resolved
Hide resolved
kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiArrowBasedResultSet.java
Outdated
Show resolved
Hide resolved
kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiArrowBasedResultSet.java
Outdated
Show resolved
Hide resolved
…ubiBaseResultSet.java
…ubiBaseResultSet.java
…ubiBaseResultSet.java
…ubiArrowBasedResultSet.java
…ubiArrowBasedResultSet.java
…ubiArrowBasedResultSet.java
…me with Calendar in ResultSet # 🔍 Description ## Issue References 🔗 This pull request fixes #5650 ## Describe Your Solution 🔧 implemented getDate, getTimestamp and getTime with Calendar in Kyuubi JDBC driver side ## Types of changes 🔖 - [ ] Bugfix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan 🧪 #### Behavior Without This Pull Request ⚰️ #### Behavior With This Pull Request 🎉 #### Related Unit Tests --- # Checklists ## 📝 Author Self Checklist - [x] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project - [x] I have performed a self-review - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) ## 📝 Committer Pre-Merge Checklist - [ ] Pull request title is okay. - [ ] No license issues. - [ ] Milestone correctly set? - [ ] Test coverage is ok - [ ] Assignees are selected. - [ ] Minimum number of approvals - [ ] No changes are requested **Be nice. Be informative.** Closes #5752 from zhaohehuhu/dev-1122. Closes #5752 ddff6a7 [Cheng Pan] Update kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiArrowBasedResultSet.java 595226d [Cheng Pan] Update kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiArrowBasedResultSet.java 8b386f1 [Cheng Pan] Update kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiArrowBasedResultSet.java 190c6b0 [Cheng Pan] Update kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiBaseResultSet.java dbc1e1e [Cheng Pan] Update kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiBaseResultSet.java e1a36d3 [Cheng Pan] Update kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiBaseResultSet.java 36710d0 [hezhao2] refactor cd2e36f [hezhao2] add UTs in SparkDataTypeTests fe60822 [hezhao2] add UTs in SparkDataTypeTests 77313c2 [hezhao2] reformat code style 33e4305 [hezhao2] JDBC driver implements Result#getTimestamp and Result#getTime with Calendar 7623b85 [hezhao2] add Overwrite annotation and remove this method from the parent abstract class 757f037 [hezhao2] JDBC driver implements Result#getDate with Calendar Lead-authored-by: hezhao2 <hezhao2@cisco.com> Co-authored-by: Cheng Pan <pan3793@gmail.com> Signed-off-by: Cheng Pan <chengpan@apache.org> (cherry picked from commit fcb41f4) Signed-off-by: Cheng Pan <chengpan@apache.org>
Thanks, merged to master/1.8 |
🔍 Description
Issue References 🔗
This pull request fixes #5650
Describe Your Solution 🔧
implemented getDate, getTimestamp and getTime with Calendar in Kyuubi JDBC driver side
Types of changes 🔖
Test Plan 🧪
Behavior Without This Pull Request ⚰️
Behavior With This Pull Request 🎉
Related Unit Tests
Checklists
📝 Author Self Checklist
📝 Committer Pre-Merge Checklist
Be nice. Be informative.