Github user gparai commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1204#discussion_r180539160
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushLimitToScanRule.java
 ---
    @@ -89,14 +92,17 @@ public void onMatch(RelOptRuleCall call) {
           RelNode child = projectRel.getInput();
           final RelNode limitUnderProject = 
limitRel.copy(limitRel.getTraitSet(), ImmutableList.of(child));
           final RelNode newProject = projectRel.copy(projectRel.getTraitSet(), 
ImmutableList.of(limitUnderProject));
    -      if (DrillRelOptUtil.isProjectOutputRowcountUnknown(projectRel)) {
    -        //Preserve limit above the project since Flatten can produce more 
rows. Also mark it so we do not fire the rule again.
    -        final RelNode limitAboveProject = new 
DrillLimitRel(limitRel.getCluster(), limitRel.getTraitSet(), newProject,
    -            limitRel.getOffset(), limitRel.getFetch(), true);
    -        call.transformTo(limitAboveProject);
    -      } else {
    -        call.transformTo(newProject);
    -      }
    +      call.transformTo(newProject);
    +      // DRILL-6318:
    --- End diff --
    
    Cleanup commented out code.


---

Reply via email to