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

Simplify "a IN (1, 2) AND a = 1" to "a = 1"

    XMLWordPrintableJSON

Details

    Description

      Calcite should simplify "a IN (1, 2) AND a = 1" to "a = 1". Check this test in RexProgramTest:

      @Test void testSimplifyInAnd() {
          // deptno in (20, 10) and deptno = 10
          //   ==>
          // deptno = 10
          final RexNode e =
              and(
                  in(vInt(), literal(20), literal(10)),
                  eq(vInt(), literal(10)));
          checkSimplify(e, "=(?0.int0, 10)");
        }
      

      Attachments

        Issue Links

          Activity

            People

              danny0405 Danny Chen
              danny0405 Danny Chen
              Votes:
              0 Vote for this issue
              Watchers:
              7 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 - 7h 20m
                  7h 20m