Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4642

PlannerImpl ignores TypeSystems provided by FrameworkConfig

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.27.0
    • 1.28.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.

      Attachments

        Activity

          People

            njriasan Nick Riasanovsky
            njriasan Nick Riasanovsky
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 50m
                2h 50m