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

RexSimplify does not exploit all known predicates

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.21.0
    • Fix Version/s: 1.22.0
    • Component/s: core

      Description

      When there are multiple predicates in RexSimplify, only the first predicates will be used to simplify the RexNode. The following test can reproduce.

      // RexProgramTest.java
      @Test public void testSimplifyRangeWithMultiPredicates() {
        final RexNode ref = input(tInt(), 0);
        RelOptPredicateList relOptPredicateList = RelOptPredicateList.of(rexBuilder,
            ImmutableList.of(gt(ref, literal(1)), le(ref, literal(5))));
        checkSimplifyFilter(gt(ref, literal(9)), relOptPredicateList, "false");
      }
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Chunwei Lei Chunwei Lei
                Reporter:
                Chunwei Lei Chunwei Lei
              • Votes:
                0 Vote for this issue
                Watchers:
                3 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 - 0.5h
                  0.5h