Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
1.27.0
-
None
Description
Hi I'm relatively new to calcite, so my apologies if anything here isn't helpful.
FrameworkConfig provides the options to set your own typeSystem via `Frameworks.newConfigBuilder().typeSystem(myTypeSystem)`. However, when later using this in a planner via `Frameworks.getPlanner(config)`, this new TypeSystem is always ignored in the implementation.
Looking into the source code, it appears to me that there are two main issues. First, the PlannerImpl doesn't extract the typeSystem from the config https://github.com/apache/calcite/blob/4bc916619fd286b2c0cc4d5c653c96a68801d74e/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java#L108 and then when generating the typeFactory it always uses the default https://github.com/apache/calcite/blob/4bc916619fd286b2c0cc4d5c653c96a68801d74e/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java#L179.
I think this should be a relatively simple change and I'm happy to provide a PR, but since I'm new to calcite I will need some input on how to properly provide tests for this. I tested this issue with an example with a class that copies `RelDataTypeSystem.DEFAULT` except, for setting `shouldConvertRaggedUnionTypesToVarying`, but there is probably an easier way to test this.