danny0405 commented on a change in pull request #1215: [CALCITE-3068]
testSubprogram() does not test whether subprogram gets re-executed
URL: https://github.com/apache/calcite/pull/1215#discussion_r285326303
##########
File path: core/src/test/java/org/apache/calcite/test/HepPlannerTest.java
##########
@@ -251,14 +251,15 @@ private void assertIncludesExactlyOnce(String message,
String digest, String sub
subprogramBuilder.addMatchOrder(HepMatchOrder.TOP_DOWN);
subprogramBuilder.addMatchLimit(1);
subprogramBuilder.addRuleInstance(ProjectToCalcRule.INSTANCE);
+ subprogramBuilder.addRuleInstance(FilterToCalcRule.INSTANCE);
subprogramBuilder.addRuleInstance(CalcMergeRule.INSTANCE);
HepProgramBuilder programBuilder = HepProgram.builder();
programBuilder.addSubprogram(subprogramBuilder.build());
checkPlanning(
programBuilder.build(),
- "select upper(ename) from (select lower(ename) as ename from emp)");
+ "select upper(ename) from (select lower(ename) as ename from emp where
empno = 100)");
Review comment:
I mostly +1 on this, but we better have a way to detect that the subProgram
really fired 2 times, or we still cannot find the bug if someone breaks the
rule and this test fire 1 times but still got passed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services