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

RelFieldTrimmer support Sort with dynamic param

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.32.0
    • 1.33.0
    • core

    Description

      If Sort rel node used dynamic param, RelFieldTrimmer can not trim fields as expected.

      The behavior makes ProjectableFilterableTable can not get correct projects.

      Related code:

      // org.apache.calcite.sql2rel.RelFieldTrimmer#trimFields(org.apache.calcite.rel.core.Sort, org.apache.calcite.util.ImmutableBitSet, java.util.Set<org.apache.calcite.rel.type.RelDataTypeField>)
      // leave the Sort unchanged in case we have dynamic limits
      if (sort.offset instanceof RexDynamicParam
          || sort.fetch instanceof RexDynamicParam) {
        return result(sort, inputMapping);
      } 

      I think we can support dynamic param without breaking anything.

      Attachments

        Issue Links

          Activity

            People

              jiajunbernoulli Jiajun Xie
              yoncise YUAN
              Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 10m
                  10m