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

IllegalStateException when FilterCorrelateRule matches a SEMI or ANTI Correlate

    XMLWordPrintableJSON

    Details

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

      Description

      FilterCorrelateRule#onMatch method executes the following:

      public void onMatch(RelOptRuleCall call) {
          final Filter filter = call.rel(0);
          final Correlate corr = call.rel(1);
          ...
          RelOptUtil.classifyFilters(
              corr,
              aboveFilters,
              JoinRelType.INNER,
              false,
              !corr.getJoinType().toJoinType().generatesNullsOnLeft(), // *** HERE!
              !corr.getJoinType().toJoinType().generatesNullsOnRight(), // *** HERE!
              aboveFilters,
              leftFilters,
              rightFilters);
          ...
      

      If the Correlate object has SemiJoinType SEMI (or ANTI), the corr.getJoinType().toJoinType() will throw a IllegalStateException:

      Caused by: java.lang.IllegalStateException: Unable to convert SEMI to JoinRelType
      	at org.apache.calcite.sql.SemiJoinType.toJoinType(SemiJoinType.java:83)
      	at org.apache.calcite.rel.rules.FilterCorrelateRule.onMatch(FilterCorrelateRule.java:89)
      	at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:205)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rubenql Ruben Q L
                Reporter:
                rubenql Ruben Q L
              • 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 - 3h 50m
                  3h 50m