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-3019: In JsonReader, update atLeastOneWrite to true if writeListDataIfTyped and writeMapDataIfTyped write a value
Date Thu, 28 May 2015 20:21:47 GMT
Repository: drill
Updated Branches:
  refs/heads/master 6f54223e4 -> 21f86effe


DRILL-3019: In JsonReader, update atLeastOneWrite to true if writeListDataIfTyped and writeMapDataIfTyped
write a value


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

Branch: refs/heads/master
Commit: 21f86effea2905aad3c18491eb1bb3e7d865bdb3
Parents: 6f54223
Author: Hsuan-Yi Chu <hsuanyi@usc.edu>
Authored: Sun May 10 16:52:08 2015 -0700
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Thu May 28 12:17:47 2015 -0700

----------------------------------------------------------------------
 .../drill/exec/vector/complex/fn/JsonReader.java |  2 ++
 .../physical/impl/filter/TestLargeInClause.java  | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/21f86eff/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/fn/JsonReader.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/fn/JsonReader.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/fn/JsonReader.java
index 095d8c6..260ebde 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/fn/JsonReader.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/fn/JsonReader.java
@@ -433,6 +433,7 @@ public class JsonReader extends BaseJsonProcessor {
    */
   private boolean writeMapDataIfTyped(MapWriter writer, String fieldName) throws IOException
{
     if (extended) {
+      atLeastOneWrite = true;
       return mapOutput.run(writer, fieldName);
     } else {
       parser.nextToken();
@@ -448,6 +449,7 @@ public class JsonReader extends BaseJsonProcessor {
    */
   private boolean writeListDataIfTyped(ListWriter writer) throws IOException {
     if (extended) {
+      atLeastOneWrite = true;
       return listOutput.run(writer);
     } else {
       parser.nextToken();

http://git-wip-us.apache.org/repos/asf/drill/blob/21f86eff/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestLargeInClause.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestLargeInClause.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestLargeInClause.java
index 281a946..22826b4 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestLargeInClause.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestLargeInClause.java
@@ -75,4 +75,23 @@ public class TestLargeInClause extends BaseTestQuery {
 
   }
 
+  @Test // DRILL-3019
+  public void testExprsInInList() throws Exception{
+    String query = "select r_regionkey \n" +
+        "from cp.`tpch/region.parquet` \n" +
+        "where r_regionkey in \n" +
+        "(1, 1 + 1, 1, 1, 1, \n" +
+        "1, 1 , 1, 1 , 1, \n" +
+        "1, 1 , 1, 1 , 1, \n" +
+        "1, 1 , 1, 1 , 1)";
+
+    testBuilder()
+        .sqlQuery(query)
+        .ordered()
+        .baselineColumns("r_regionkey")
+        .baselineValues(1)
+        .baselineValues(2)
+        .build()
+        .run();
+  }
 }


Mime
View raw message