[
https://issues.apache.org/jira/browse/CALCITE-4642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nick Riasanovsky reassigned CALCITE-4642:
-----------------------------------------
Assignee: Nick Riasanovsky
> PlannerImpl ignores TypeSystems provided by FrameworkConfig
> -----------------------------------------------------------
>
> Key: CALCITE-4642
> URL: https://issues.apache.org/jira/browse/CALCITE-4642
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.27.0
> Reporter: Nick Riasanovsky
> Assignee: Nick Riasanovsky
> Priority: Trivial
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)