Ap-95671 commented on code in PR #1546:
URL: https://github.com/apache/arrow-java/pull/1546#discussion_r4775081743


##########
flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/accessor/impl/complex/ArrowFlightJdbcStructVectorAccessor.java:
##########
@@ -53,6 +54,14 @@ public Object getObject() {
     return object;
   }
 
+  @Override
+  public <T> T getObject(Class<T> type) throws SQLException {
+    if (type == Struct.class) {
+      return type.cast(getStruct());

Review Comment:
   [P2] Support an empty JDBC type map on the new `Struct` return value. I 
extended `testStructMetadataAndObjectAccess` with `assertArrayEquals(new 
Object[] {12}, result.getObject(1, Struct.class).getAttributes(Map.of()))`. On 
JDK 21 this throws `UnsupportedOperationException` from Avatica’s `StructImpl`; 
the no-arg call directly above it returns `[12]`. An empty map should use the 
default attribute mappings. Could the returned `Struct` delegate that case to 
`getAttributes()` and report unsupported custom mappings as a `SQLException` 
subtype?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to