Github user gparai commented on a diff in the pull request:
https://github.com/apache/drill/pull/1096#discussion_r171086924
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushLimitToScanRule.java
---
@@ -55,18 +62,21 @@ public void onMatch(RelOptRuleCall call) {
}
};
- public static DrillPushLimitToScanRule LIMIT_ON_PROJECT =
- new DrillPushLimitToScanRule(
- RelOptHelper.some(DrillLimitRel.class, RelOptHelper.some(
- DrillProjectRel.class,
RelOptHelper.any(DrillScanRel.class))),
- "DrillPushLimitToScanRule_LimitOnProject") {
+ public static DrillPushLimitToScanRule LIMIT_ON_PROJECT = new
DrillPushLimitToScanRule(
--- End diff --
There are many instances where we would have a PROJECT on top of the SCAN.
The way the rule is refactored now the LIMIT_SCAN rule would not work unless we
do LIMIT_PROJECT. Hence, these rules should go together for LIMIT_SCAN to work
effectively. That is the reason I kept the rule here rather than creating a new
rule.
---