jbonofre commented on code in PR #1391:
URL: https://github.com/apache/arrow-java/pull/1391#discussion_r4377458985
##########
flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowDatabaseMetadata.java:
##########
@@ -1001,6 +1026,192 @@ public ResultSet getPrimaryKeys(final String catalog,
final String schema, final
connection, flightInfoPrimaryKeys, transformer);
}
+ @Override
+ public ResultSet getTypeInfo() throws SQLException {
+ final ArrowFlightConnection connection = getConnection();
+ final BufferAllocator allocator = connection.getBufferAllocator();
+
+ final FlightInfo flightInfoTypeInfo;
+ try {
+ flightInfoTypeInfo = connection.getClientHandler().getXdbcTypeInfo();
+ } catch (final FlightRuntimeException e) {
+ throw new SQLException("Failed to retrieve type info.", e);
Review Comment:
This changes the behavior. `getTypeInfo()` used to return an empty 18-column
result set without any RPC. Now any `FlightRuntimeException` becomes a
`SQLException`, including `UNIMPLEMENTED` from servers that don't support
`CommandGetXdbcTypeInfo`. BI tools and ORMs commonly call `getTypeInfo()` while
setting up a connection, so those servers would now fail to connect.
Could we catch `CallStatus.UNIMPLEMENTED` here (and later), and return
`super.getTypeInfo()` as before?
Only other failures should surface as `SQLException`.
Maybe we could add a test using
`setTypeInfoFlightInfoFailure(CallStatus.UNIMPLEMENTED..)`.
--
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]