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 condition.
In this case a new RelNode shouldn't be created. Possible fix to change logic of RelBuilder#filter method.
TestCase for reproduce: