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

Computing RexCall digest containing IN expressions leads to Exceptions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.19.0
    • Component/s: None

      Description

      Testcase:

       /*  RexProgramTest */
        @Test public void testInDigest() {
          RexNode e = in(vInt(), literal(1), literal(2));
          assertThat(e.toString(), is("IN(?0.int0, 1, 2)"));
        }
       /*  RexProgramBuilder */
        protected RexNode in(Iterable<? extends RexNode> nodes) {
          return rexBuilder.makeCall(SqlStdOperatorTable.IN,
              ImmutableList.copyOf(nodes));
        }
      

      The exception is due to that it tries to look at the other operand https://github.com/apache/calcite/blob/883666929478aabe07ee5b9e572c43a6f1a703e2/core/src/main/java/org/apache/calcite/rex/RexCall.java#L115

      SIMPLE_BINARY_OPS contains COMPARISION which also contains "IN"

      this was introduced in CALCITE-2454 a few days ago; bug not released

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kgyrtkirk Zoltan Haindrich
                Reporter:
                kgyrtkirk Zoltan Haindrich
              • 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 - 40m
                  40m