drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject [2/2] drill git commit: DRILL-2376: In UnionAllRecordBactch, the mechansim to detect schema change is corrected
Date Thu, 07 May 2015 21:19:59 GMT
DRILL-2376: In UnionAllRecordBactch, the mechansim to detect schema change is corrected


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

Branch: refs/heads/master
Commit: 8c706e6fa44e100cef6c117ddeceb238d150e89d
Parents: 868ce4d
Author: Hsuan-Yi Chu <hsuanyi@usc.edu>
Authored: Thu Apr 23 13:44:13 2015 -0700
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Thu May 7 14:03:41 2015 -0700

----------------------------------------------------------------------
 .../impl/union/UnionAllRecordBatch.java         |  4 +--
 .../java/org/apache/drill/TestUnionAll.java     | 32 ++++++++++++++++++--
 .../testframework/testUnionAllQueries/q18.tsv   | 15 ---------
 .../testframework/testUnionAllQueries/q18_1.tsv | 15 +++++++++
 .../testframework/testUnionAllQueries/q18_2.tsv | 13 ++++++++
 .../testframework/testUnionAllQueries/q18_3.tsv | 13 ++++++++
 6 files changed, 72 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/8c706e6f/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 d7ea3bb..66bc3e3 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
@@ -400,9 +400,9 @@ public class UnionAllRecordBatch extends AbstractRecordBatch<UnionAll>
{
                 throw new SchemaChangeException("Schema change detected in the left input
of Union-All. This is not currently supported");
               }
 
-              upstream = IterOutcome.OK;
+              iterOutcome = IterOutcome.OK;
               // fall through
-              case OK:
+            case OK:
               unionAllRecordBatch.setCurrentRecordBatch(leftSide.getRecordBatch());
               upstream = iterOutcome;
               return upstream;

http://git-wip-us.apache.org/repos/asf/drill/blob/8c706e6f/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 72f52e9..5f98d90 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
@@ -375,15 +375,41 @@ public class TestUnionAll extends BaseTestQuery{
     String rootDate = FileUtils.getResourceAsFile("/store/json/dateData.json").toURI().toString();
     String rootTimpStmp = FileUtils.getResourceAsFile("/store/json/timeStmpData.json").toURI().toString();
 
-    String query = String.format(
+    String query1 = String.format(
         "(select max(key) as key from dfs_test.`%s` " +
         "union all " +
         "select key from dfs_test.`%s`)", rootDate, rootTimpStmp);
 
+    String query2 = String.format(
+        "select key from dfs_test.`%s` " +
+        "union all " +
+        "select max(key) as key from dfs_test.`%s`", rootDate, rootTimpStmp);
+
+    String query3 = String.format(
+        "select key from dfs_test.`%s` " +
+        "union all " +
+        "select max(key) as key from dfs_test.`%s`", rootDate, rootTimpStmp);
+
     testBuilder()
-        .sqlQuery(query)
+        .sqlQuery(query1)
+        .unOrdered()
+        .csvBaselineFile("testframework/testUnionAllQueries/q18_1.tsv")
+        .baselineTypes(TypeProtos.MinorType.VARCHAR)
+        .baselineColumns("key")
+        .build().run();
+
+    testBuilder()
+        .sqlQuery(query2)
+        .unOrdered()
+        .csvBaselineFile("testframework/testUnionAllQueries/q18_2.tsv")
+        .baselineTypes(TypeProtos.MinorType.VARCHAR)
+        .baselineColumns("key")
+        .build().run();
+
+    testBuilder()
+        .sqlQuery(query3)
         .unOrdered()
-        .csvBaselineFile("testframework/testUnionAllQueries/q18.tsv")
+        .csvBaselineFile("testframework/testUnionAllQueries/q18_3.tsv")
         .baselineTypes(TypeProtos.MinorType.VARCHAR)
         .baselineColumns("key")
         .build().run();

http://git-wip-us.apache.org/repos/asf/drill/blob/8c706e6f/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18.tsv
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18.tsv b/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18.tsv
deleted file mode 100644
index ccf0d35..0000000
--- a/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18.tsv
+++ /dev/null
@@ -1,15 +0,0 @@
-2011-07-26
-2015-03-26 19:04:55.542
-2015-03-26 19:04:55.542
-2015-03-26 19:04:55.542
-2015-03-26 19:04:55.543
-2015-03-26 19:04:55.543
-2015-03-26 19:04:55.543
-2015-03-26 19:04:55.543
-2015-03-26 19:04:55.543
-2015-03-26 19:04:55.543
-2015-03-26 19:04:55.544
-2015-03-26 19:04:55.544
-2015-03-26 19:04:55.544
-2015-03-26 19:04:55.544
-2015-03-26 19:04:55.544
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/drill/blob/8c706e6f/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18_1.tsv
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18_1.tsv
b/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18_1.tsv
new file mode 100644
index 0000000..ccf0d35
--- /dev/null
+++ b/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18_1.tsv
@@ -0,0 +1,15 @@
+2011-07-26
+2015-03-26 19:04:55.542
+2015-03-26 19:04:55.542
+2015-03-26 19:04:55.542
+2015-03-26 19:04:55.543
+2015-03-26 19:04:55.543
+2015-03-26 19:04:55.543
+2015-03-26 19:04:55.543
+2015-03-26 19:04:55.543
+2015-03-26 19:04:55.543
+2015-03-26 19:04:55.544
+2015-03-26 19:04:55.544
+2015-03-26 19:04:55.544
+2015-03-26 19:04:55.544
+2015-03-26 19:04:55.544
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/drill/blob/8c706e6f/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18_2.tsv
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18_2.tsv
b/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18_2.tsv
new file mode 100644
index 0000000..123efc6
--- /dev/null
+++ b/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18_2.tsv
@@ -0,0 +1,13 @@
+2009-03-03
+2001-08-27
+2011-07-26
+1970-09-02
+1983-04-24
+2007-02-01
+1977-08-03
+1962-05-14
+1950-02-16
+1983-09-05
+2000-09-09
+1960-08-18
+2015-03-26 19:04:55.544
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/drill/blob/8c706e6f/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18_3.tsv
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18_3.tsv
b/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18_3.tsv
new file mode 100644
index 0000000..123efc6
--- /dev/null
+++ b/exec/java-exec/src/test/resources/testframework/testUnionAllQueries/q18_3.tsv
@@ -0,0 +1,13 @@
+2009-03-03
+2001-08-27
+2011-07-26
+1970-09-02
+1983-04-24
+2007-02-01
+1977-08-03
+1962-05-14
+1950-02-16
+1983-09-05
+2000-09-09
+1960-08-18
+2015-03-26 19:04:55.544
\ No newline at end of file


Mime
View raw message