Vitalii Diravka created CALCITE-2205:

             Summary: One more Infinite loop for 
                 Key: CALCITE-2205
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.15.0
            Reporter: Vitalii Diravka
            Assignee: Julian Hyde
             Fix For: 1.16.0

CALCITE-2200 resolves some cases of infinite loop via stopping of recursion in 
HepPlanner#applyRules, when newVertex is the same as vertex.

In this jira one more case of infinite loop is described:
JoinPushTransitivePredicatesRule#onMatch generates new right or left inputs via 
using RelBuilder#filter method on top of LogicalFilter RelNode with the same 
In this case a new RelNode shouldn't be created. Possible fix to change logic 
in onMatch method of the rule or the logic of RelBuilder#filter method.

TestCase for reproduce:
  @Test public void testJoinPushTransitivePredicatesRule2() {
    HepProgramBuilder builder = new HepProgramBuilder();
    HepProgram build =;
    HepPlanner hepPlanner = new HepPlanner(build);

    final String sql = "select n1.SAL from EMPNULLABLES_20 n1 where n1.SAL\n"
        + "IN (select n2.SAL from EMPNULLABLES_20 n2 "
        + "where n1.SAL = n2.SAL or n1.SAL = 4)";


This message was sent by Atlassian JIRA

Reply via email to