alexandrefimov commented on code in PR #5316:
URL: https://github.com/apache/calcite/pull/5316#discussion_r4317469283
##########
core/src/main/java/org/apache/calcite/jdbc/CalciteConnectionImpl.java:
##########
@@ -136,8 +138,14 @@ protected CalciteConnectionImpl(Driver driver,
AvaticaFactory factory,
RelDataTypeSystem typeSystem =
cfg.typeSystem(RelDataTypeSystem.class, RelDataTypeSystem.DEFAULT);
if (cfg.conformance().shouldConvertRaggedUnionTypesToVarying()) {
+ final RelDataTypeSystem originalTypeSystem = typeSystem;
typeSystem =
- new DelegatingTypeSystem(typeSystem) {
+ new DelegatingTypeSystem(originalTypeSystem) {
Review Comment:
The conformance flag installs a `DelegatingTypeSystem` wrapper. That class
inherits the default `deriveDecimalDivideType`, so it loses the configured
division rule. This override preserves that rule. Without it, `DECIMAL(6,2) /
DECIMAL(6,2)` returns `DECIMAL(15,6)` instead of `DECIMAL(15,9)` in these
conformance modes.
--
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]