use of org.apache.calcite.rel.rules.FilterMultiJoinMergeRule in project calcite by apache.
the class RelOptRulesTest method testFilterAndProjectWithMultiJoin.
@Test
void testFilterAndProjectWithMultiJoin() {
final HepProgram preProgram = new HepProgramBuilder().addRuleCollection(Arrays.asList(MyFilterRule.INSTANCE, MyProjectRule.INSTANCE)).build();
final FilterMultiJoinMergeRule filterMultiJoinMergeRule = FilterMultiJoinMergeRule.Config.DEFAULT.withOperandFor(MyFilter.class, MultiJoin.class).toRule();
final ProjectMultiJoinMergeRule projectMultiJoinMergeRule = ProjectMultiJoinMergeRule.Config.DEFAULT.withOperandFor(MyProject.class, MultiJoin.class).toRule();
HepProgram program = new HepProgramBuilder().addRuleCollection(Arrays.asList(CoreRules.JOIN_TO_MULTI_JOIN, filterMultiJoinMergeRule, projectMultiJoinMergeRule)).build();
sql("select * from emp e1 left outer join dept d on e1.deptno = d.deptno where d.deptno > 3").withPre(preProgram).withProgram(program).check();
}
Aggregations