Repository navigation
[Flight SQL][JDBC] Implement DatabaseMetaData.getTypeInfo via GetXdbcTypeInfo #1382
Description
Describe the enhancement requested
Please implement Flight SQL JDBC DatabaseMetaData.getTypeInfo() using the server's GetXdbcTypeInfo endpoint.
Observed behavior
With arrow-flight-sql-jdbc 19.0.0, DatabaseMetaData.getTypeInfo() returns an empty ResultSet against our Redis Flight SQL server, while a direct Go Flight SQL GetXdbcTypeInfo call returns the server's canonical scalar type metadata. This is a client metadata capability gap, independent of query result schemas or GetTables.
Our October 20, 2026 smoke test records the empty JDBC result explicitly:
https://github.com/alberttwong/redis-apache-arrow-flight/blob/72db508ed1c6c7fc3321bb874ea52898cca3966f/examples/jdbc/JdbcSmoke.java
Server implementation and direct protocol tests in that same revision:
- server/typeinfo.go
- server/capabilities_test.go (TestFlightTypeInfo and TestIntegrationTypeInfoDDL)
Compatibility notes:
https://github.com/alberttwong/redis-apache-arrow-flight/blob/72db508ed1c6c7fc3321bb874ea52898cca3966f/docs/client-compatibility.md
Environment: JDBC 19.0.0, Temurin Java 25 for the local client, Arrow Go 18.8.0 server, Redis 8.6.2. This report uses the preserved integration result; no new live reproduction was run while filing it. GitHub's latest Arrow Java release was v19.0.0 when checked, and current main's ArrowFlightMetaImpl extends Avatica MetaImpl without a getTypeInfo override.
Minimal client check
Against a Flight SQL server that implements GetXdbcTypeInfo and returns a nonempty supported type list:
try (Connection c = DriverManager.getConnection(url);
ResultSet types = c.getMetaData().getTypeInfo()) {
int count = 0;
while (types.next()) {
System.out.println(types.getString("TYPE_NAME") + " / " + types.getInt("DATA_TYPE"));
count++;
}
System.out.println("type rows: " + count);
}Observed: zero rows. Direct protocol check against the same server: nonempty standard-schema type rows.
Requested behavior
- Forward JDBC type discovery to Flight SQL GetXdbcTypeInfo and map the standard Flight SQL fields to the JDBC ResultSet contract.
- Preserve nullability and ordering as required by JDBC; do not fabricate precision/scale values when unknown.
- Add coverage for a nonempty type list, optional NULL metadata, an empty list and unsupported/error responses.
- Keep resource cleanup and server errors visible.
This would let JDBC applications discover the types the server supports. It does not establish general DBeaver/Tableau compatibility. If there is already a supported path or an existing tracker, please point us to it. Searches for getTypeInfo and type information did not locate a matching issue/PR; #180 concerns GetTables/GetSchemas field naming instead.
Activity
hutiefang76 commentedon Oct 24, 2026
I’ll work on the JDBC mapping for this. The current driver inherits an empty
getTypeInfo()result even thoughFlightSqlClientalready exposes GetXdbcTypeInfo.I’ll keep the change in the JDBC metadata bridge and test it against an in-process Flight SQL server: the 18 JDBC columns, CREATE_PARAMS conversion, nullable values, empty results, server failures and stream cleanup. Existing protocol fields and server ordering will be preserved.
AI-generated coordination comment; investigation, implementation and validation assisted by Codex and DeepSeek.
apacheGH-1382: Preserve empty type info for unsupported servers