alexandrefimov commented on code in PR #5316:
URL: https://github.com/apache/calcite/pull/5316#discussion_r4317731627


##########
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 ragged-union flag causes JDBC to wrap the configured type system in 
`DelegatingTypeSystem`. That wrapper uses the default `deriveDecimalDivideType` 
instead of the custom override. I added the forwarding here so that enabling 
this conformance setting would preserve the custom division rule.
   
   This is an existing problem with how JDBC wraps custom type systems. I 
suggest fixing it in a separate PR with a regression test, then keeping this PR 
focused on opt-in decimal division. Would that make sense?



-- 
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]

Reply via email to