drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject drill git commit: DRILL-2717: The upstream message returned by Union-All (when innerNext is called on Union-All) is corrected
Date Fri, 10 Apr 2015 21:06:24 GMT
Repository: drill
Updated Branches:
  refs/heads/master cbfe5772d -> 8217ec98b


DRILL-2717: The upstream message returned by Union-All (when innerNext is called on Union-All)
is corrected


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/8217ec98
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/8217ec98
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/8217ec98

Branch: refs/heads/master
Commit: 8217ec98bdc0cba7b1c922cf802698b442eb8937
Parents: cbfe577
Author: Hsuan-Yi Chu <hsuanyi@usc.edu>
Authored: Mon Apr 6 11:36:50 2015 -0700
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Fri Apr 10 13:57:52 2015 -0700

----------------------------------------------------------------------
 .../impl/union/UnionAllRecordBatch.java         |  3 +-
 .../java/org/apache/drill/TestUnionAll.java     | 30 ++++++++++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/8217ec98/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java
index 61de3a4..b472890 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/union/UnionAllRecordBatch.java
@@ -330,8 +330,7 @@ public class UnionAllRecordBatch extends AbstractRecordBatch<UnionAll>
{
               if(!rightSide.getRecordBatch().getSchema().equals(rightSchema)) {
                 throw new SchemaChangeException("Schema change detected in the right input
of Union-All. This is not currently supported");
               }
-
-              upstream = IterOutcome.OK;
+              iterOutcome = IterOutcome.OK;
               // fall through
             case OK:
               unionAllRecordBatch.setCurrentRecordBatch(rightSide.getRecordBatch());

http://git-wip-us.apache.org/repos/asf/drill/blob/8217ec98/exec/java-exec/src/test/java/org/apache/drill/TestUnionAll.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestUnionAll.java b/exec/java-exec/src/test/java/org/apache/drill/TestUnionAll.java
index 7033013..3a4f748 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestUnionAll.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestUnionAll.java
@@ -429,4 +429,34 @@ public class TestUnionAll extends BaseTestQuery{
          .baselineValues((long) 10)
          .build().run();
   }
+
+  @Test // see DRILL-2717
+  public void testUnionInputsGroupByOnCSV() throws Exception {
+    String root = FileUtils.getResourceAsFile("/multilevel/csv/1994/Q1/orders_94_q1.csv").toURI().toString();
+    String query = String.format("select * from \n" +
+            "((select columns[0] as col0 from dfs.`%s` t1 \n" +
+            "where t1.columns[0] = 66) \n" +
+            "union all \n" +
+            "(select columns[0] c2 from dfs.`%s` t2 \n" +
+            "where t2.columns[0] is not null \n" +
+            "group by columns[0])) \n" +
+        "group by col0"
+        , root, root);
+    
+    testBuilder()
+        .sqlQuery(query)
+        .unOrdered()
+        .baselineColumns("col0")
+        .baselineValues("290")
+        .baselineValues("291")
+        .baselineValues("323")
+        .baselineValues("352")
+        .baselineValues("389")
+        .baselineValues("417")
+        .baselineValues("66")
+        .baselineValues("673")
+        .baselineValues("833")
+        .baselineValues("99")
+        .build().run();
+  }
 }
\ No newline at end of file


Mime
View raw message