AlexisCubilla opened a new pull request, #4941:
URL: https://github.com/apache/calcite/pull/4941
Problem:
JdbcSchema builds RelDataType from DatabaseMetaData (COLUMN_SIZE,
DECIMAL_DIGITS). Some JDBC drivers (notably PostgreSQL) return COLUMN_SIZE 0
for NUMERIC/DECIMAL columns declared without explicit precision. That led to
createSqlType(DECIMAL, 0, scale), which SqlTypeFactoryImpl rejects ("DECIMAL
precision 0 must be between 1 and ...").
Root cause:
sqlType() treated any non-negative precision as literal. Zero is used by
drivers as "unspecified" / unknown width, not as a valid SQL DECIMAL precision.
Fix:
When sqlTypeName is DECIMAL and reported precision is 0, replace it with
typeFactory.getTypeSystem().getDefaultPrecision(DECIMAL) before createSqlType.
CALCITE-7524
--
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]