DBC Driver returns missing COLUMN_SIZE in DatabaseMetaData.getColumns() for VARCHAR columns mapped from Spark/Hive STRING #7629
Unanswered
ankursaini2006
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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