Github user amansinha100 commented on a diff in the pull request:
https://github.com/apache/drill/pull/1096#discussion_r165788152
--- 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 --
I am not sure why this rule is being overloaded for doing limit push past
project. This particular rule is about doing limit pushdown into scan for
cases where we have LIMIT-SCAN or LIMIT-PROJECT-SCAN. I think we should keep
this rule as-is but create a separate rule that does a limit push past project.
Was there a strong reason to do it this way ? Could there be a side effect of
removing the check for the Scan ?
---