-
Notifications
You must be signed in to change notification settings - Fork 169
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
SNOW-1812949 add get object and get bytes support for native arrow structured types #1968
base: master
Are you sure you want to change the base?
SNOW-1812949 add get object and get bytes support for native arrow structured types #1968
Conversation
…ormat ARROW is set
…, add variant test case
return createJsonSqlInput(columnIndex, obj); | ||
} else if (converter instanceof StructConverter) { | ||
return createArrowSqlInput(columnIndex, (Map<String, Object>) obj); | ||
if (type == Types.STRUCT && isStructuredType && converter instanceof VarCharConverter) { |
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 we extract these conditions?
return text; | ||
} | ||
|
||
private static String buildJsonStringFromElements(Object elements) throws SQLException { | ||
try { | ||
return SnowflakeUtil.mapJson(elements); |
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.
Here, we create JSON using ObjectMapper. Shouldn't it be created by our types mappers?
private int baseType; | ||
private Object elements; | ||
|
||
public SfSqlArray(String text, int baseType, Object elements) { |
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.
- can we reuse new constructor in other constructors?
- can we remove other constructors?
@@ -0,0 +1,22 @@ | |||
package net.snowflake.client.core.arrow; |
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 license header
public void testRunAsGetString() throws SQLException { | ||
withFirstRow( | ||
connections.get(queryResultFormat), | ||
selectSql, | ||
(resultSet) -> assertGetStringIsCompatible(resultSet, expectedStructureTypeRepresentation)); | ||
} | ||
|
||
@Test | ||
public void testRunAsGetObject() 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.
we are fetching and getting the same data for Object and Bytes - can we run bot (or even more tests) on the same result set?
Add getObject and getBytes implementations for native arrow structured types
SNOW-1812949
The getString unification was already introduced to JDBC driver. This PR introduces changes for getObject and getBytes functions:
Pre-review self checklist
master
branchmvn -P check-style validate
)mvn verify
and inspecttarget/japicmp/japicmp.html
)SNOW-XXXX: