[GitHub] drill pull request #1204: DRILL-6318

2018-04-10 Thread gparai
Github user gparai commented on a diff in the pull request:

https://github.com/apache/drill/pull/1204#discussion_r180538860
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushLimitToScanRule.java
 ---
@@ -74,9 +74,12 @@ public boolean matches(RelOptRuleCall call) {
   // mess up the schema since Convert_FromJson() is different from 
other regular functions in that it only knows
   // the output schema after evaluation is performed. When input has 0 
row, Drill essentially does not have a way
   // to know the output type.
+  // DRILL-6318:
--- End diff --

Please remove JIRA ref here and below - others can get it via annotations.


---


[GitHub] drill pull request #1204: DRILL-6318

2018-04-10 Thread gparai
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.


---


[GitHub] drill pull request #1204: DRILL-6318

2018-04-10 Thread gparai
Github user gparai commented on a diff in the pull request:

https://github.com/apache/drill/pull/1204#discussion_r180539313
  
--- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/flatten/TestFlattenPlanning.java
 ---
@@ -66,8 +66,11 @@ public void testPushFilterPastProjectWithFlattenNeg() 
throws Exception {
   @Test // DRILL-6099 : push limit past flatten(project)
   public void testLimitPushdownPastFlatten() throws Exception {
 final String query = "select rownum, flatten(complex) comp from 
cp.`store/json/test_flatten_mappify2.json` limit 1";
-final String[] expectedPatterns = 
{".*Limit\\(fetch=\\[1\\]\\).*",".*Flatten.*",".*Limit\\(fetch=\\[1\\]\\).*"};
-final String[] excludedPatterns = null;
+//DRILL-6318 : limit should not push past flatten(project)
+//P.S. Where was an error in this pattern. Even then Limit missing 
after Flatten it matches to plan
--- End diff --

Remove the P.S. and commented out pattern.


---


[GitHub] drill pull request #1204: DRILL-6318

2018-04-10 Thread oleg-zinovev
GitHub user oleg-zinovev opened a pull request:

https://github.com/apache/drill/pull/1204

DRILL-6318

Test for DRILL-6099 was changed due it's incorrect behavior 

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/oleg-zinovev/drill drill-6318

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/drill/pull/1204.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1204


commit 5a6c96240d8e7d0409481f63036d63b572fe4d26
Author: Oleg 
Date:   2018-04-10T08:26:25Z

DRILL-6318




---