DRILL-1278: Fix selecting scalar field from a map with join clause.

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

Branch: refs/heads/master
Commit: 81bd7527846318610a3367e4bd756d269fedfb9c
Parents: d4a07db
Author: Mehant Baid <meha...@gmail.com>
Authored: Mon Aug 11 18:04:30 2014 -0700
Committer: Aditya Kishore <adi...@maprtech.com>
Committed: Mon Aug 18 14:56:52 2014 +0530

----------------------------------------------------------------------
 .../drill/exec/physical/impl/project/ProjectRecordBatch.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/81bd7527/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 1ba0103..fcc216f 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
@@ -309,6 +309,7 @@ public class ProjectRecordBatch extends 
AbstractSingleRecordBatch<Project>{
 
       String outputName = getRef(namedExpression).getRootSegment().getPath();
       if (result != null && result.outputNames != null && 
result.outputNames.size() > 0) {
+        // TODO: Revisit this logic. It is possible that the output names 
array does not contain the expression of interest in index 0
         if (result.outputNames.get(0) == EMPTY_STRING) continue;
         outputName = result.outputNames.get(0);
       }
@@ -406,11 +407,10 @@ public class ProjectRecordBatch extends 
AbstractSingleRecordBatch<Project>{
       if (!(ex.getExpr() instanceof SchemaPath)) continue;
       NameSegment expr = ((SchemaPath) ex.getExpr()).getRootSegment();
       NameSegment ref = ex.getRef().getRootSegment();
-      boolean exprHasPrefix = 
expr.getPath().contains(StarColumnHelper.PREFIX_DELIMITER);
       boolean refHasPrefix = 
ref.getPath().contains(StarColumnHelper.PREFIX_DELIMITER);
       boolean exprContainsStar = 
expr.getPath().contains(StarColumnHelper.STAR_COLUMN);
       
-      if (exprHasPrefix || refHasPrefix || exprContainsStar) {
+      if (refHasPrefix || exprContainsStar) {
         needed = true;
         break;
       }

Reply via email to