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-1811: select A, * from ... crashes JVM
Date Tue, 09 Dec 2014 22:13:04 GMT
Repository: drill
Updated Branches:
  refs/heads/0.7.0 201280e6e -> c65928fed


DRILL-1811: select A, * from ... crashes JVM


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

Branch: refs/heads/0.7.0
Commit: c65928fedf67e7d7d8f26f8813b4640845fe6595
Parents: 201280e
Author: Hsuan-Yi Chu <hsuanyi@usc.edu>
Authored: Fri Dec 5 10:45:49 2014 -0800
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Tue Dec 9 10:11:21 2014 -0800

----------------------------------------------------------------------
 .../drill/exec/physical/impl/project/ProjectRecordBatch.java   | 6 ++----
 .../src/test/java/org/apache/drill/TestExampleQueries.java     | 6 ++++++
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/c65928fe/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
index f822e55..387c2f2 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
@@ -283,8 +283,7 @@ public class ProjectRecordBatch extends AbstractSingleRecordBatch<Project>
{
       return false;
     }
     NameSegment expr = ((SchemaPath)ex.getExpr()).getRootSegment();
-    NameSegment ref = ex.getRef().getRootSegment();
-    return ref.getPath().equals("*") && expr.getPath().equals("*");
+    return expr.getPath().contains(StarColumnHelper.STAR_COLUMN);
   }
 
   @Override
@@ -308,7 +307,7 @@ public class ProjectRecordBatch extends AbstractSingleRecordBatch<Project>
{
 
     IntOpenHashSet transferFieldIds = new IntOpenHashSet();
 
-    boolean isAnyWildcard = false;
+    boolean isAnyWildcard = isAnyWildcard(exprs);
 
     ClassifierResult result = new ClassifierResult();
     boolean classify = isClassificationNeeded(exprs);
@@ -321,7 +320,6 @@ public class ProjectRecordBatch extends AbstractSingleRecordBatch<Project>
{
         classifyExpr(namedExpression, incoming, result);
 
         if (result.isStar) {
-          isAnyWildcard = true;
           Integer value = result.prefixMap.get(result.prefix);
           if (value != null && value.intValue() == 1) {
             int k = 0;

http://git-wip-us.apache.org/repos/asf/drill/blob/c65928fe/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java b/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
index 3caede7..987c070 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
@@ -27,6 +27,12 @@ import org.junit.Test;
 public class TestExampleQueries extends BaseTestQuery{
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(TestExampleQueries.class);
 
+  @Test // see DRILL-1811
+  public void testSelStarDifferentColumnOrder() throws Exception {
+    test("select first_name, * from cp.`employee.json`;");
+    test("select *, first_name, *, last_name from cp.`employee.json`;");
+  }
+
   @Test // see DRILL-985
   public void testViewFileName() throws Exception {
     test("use dfs.tmp");


Mime
View raw message