-
Notifications
You must be signed in to change notification settings - Fork 25
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
Adding Array Support including Unit Tests #81
base: main
Are you sure you want to change the base?
Conversation
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.
Few small comments. I'm going to test this manually to verify.
For documentation purposes can you add to PR description screenshots how it looks with and without this fix? Please add you sample data and mapping to let others verify the test.
Thanks
@@ -61,15 +63,17 @@ public enum OpenSearchType { | |||
STRING(JDBCType.VARCHAR, String.class, Integer.MAX_VALUE, 0, false), | |||
IP(JDBCType.VARCHAR, String.class, 15, 0, false), | |||
NESTED(JDBCType.STRUCT, null, 0, 0, false), |
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.
Maybe nested should be mapped to array
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.
Could you explain why? I may not be following.
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.
Nested
is mapped to ARRAY
in sql plugin, curious why it is different here?
OpenSearchDataType.java#L39
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.
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.
A bug of workbench?
…lity Signed-off-by: Andrey Kuzin <akuzin@amazon.com>
The sample data I used to populate OpenSearch Index:
|
@@ -61,15 +63,17 @@ public enum OpenSearchType { | |||
STRING(JDBCType.VARCHAR, String.class, Integer.MAX_VALUE, 0, false), | |||
IP(JDBCType.VARCHAR, String.class, 15, 0, false), | |||
NESTED(JDBCType.STRUCT, null, 0, 0, false), |
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.
A bug of workbench?
Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com> Signed-off-by: akuzin1 <111004764+akuzin1@users.noreply.github.com>
I suspended this PR, because it is blocked by opensearch-project/sql#1300. We need to implement this feature in SQL plugin prior to make any changes in JDBC. |
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Description
Even though there is no dedicated array field type in OpenSearch, one can still pass an array of values into any field. However, currently there is no way to take advantage of that feature. Therefore, I added Array support to the driver, so that the user can call
getArray(<column-index>)
to retrieve the array object stored as a field from the returned ResultSet.Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.