AlexisCubilla opened a new pull request, #4937: URL: https://github.com/apache/calcite/pull/4937
[CALCITE-5212] Include DECIMAL scale in type digest when precision unspecified Problem: createSqlType(DECIMAL, PRECISION_NOT_SPECIFIED, scale) could return types that collided in DATATYPE_CACHE: same digest/hash for different scales because BasicSqlType.generateTypeString() only appended scale when printPrecision was true, so scale was omitted when precision was PRECISION_NOT_SPECIFIED. Root cause: The digest string did not distinguish DECIMAL types that differed only by scale while precision stayed unspecified, breaking equals/hashCode/canonize. Fix: When precision is not specified but scale is, append "(PRECISION_NOT_SPECIFIED, scale)" to the digest for DECIMAL (see generateTypeString). Testing: ./gradlew :core:test --tests "org.apache.calcite.sql.type.SqlTypeFactoryTest" https://issues.apache.org/jira/browse/CALCITE-5212 -- 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]
