Repository navigation
DBC Driver returns missing COLUMN_SIZE in DatabaseMetaData.getColumns() for VARCHAR columns mapped from Spark/Hive STRING #7629
Replies: 1 comment
|
The Spark-engine path currently produces exactly that combination. So for this path, the missing value originates in the engine's metadata result, not a JDBC-driver length setting. An A useful regression case is a Spark table with one |
Uh oh!
There was an error while loading. Please reload this page.
Problem Description
When querying tables or inspecting metadata through the Kyuubi JDBC driver using third-party JDBC frameworks (specifically Trino's JDBC connector), operations fail with the following exception:
java.lang.IllegalStateException: column size not present
Root Cause & Investigation
BaseJdbcClient.toColumnMapping(), when mappingTypes.VARCHAR(JDBC type code12), it callsJdbcTypeHandle.getRequiredColumnSize().COLUMN_SIZEinDatabaseMetaData.getColumns()(orResultSetMetaData.getPrecision()) to be populated.STRING(which has no defined length bound), the Kyuubi JDBC driver reports the JDBC data type as12(VARCHAR), but leavesCOLUMN_SIZEnullor unpopulated.VARCHARcolumn size fail with a null/missing field error instead of treating it as unbounded.Question for the Community
COLUMN_SIZE(e.g.,Integer.MAX_VALUEor a configurable max length) for Spark/Hive unboundedSTRINGtypes mapped toVARCHAR?DatabaseMetaData?All reactions