You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ad...@apache.org on 2016/09/13 01:32:10 UTC

[23/50] [abbrv] drill git commit: MD-578: Query with three-way join fails with IllegalStateException

MD-578: Query with three-way join fails with IllegalStateException


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

Branch: refs/heads/master
Commit: 1887de29990dc1144544b285e262970c1d2ae99a
Parents: 1f853f6
Author: Smidth Panchamia <sp...@mapr.com>
Authored: Fri Jan 8 10:00:57 2016 -0800
Committer: Aditya Kishore <ad...@apache.org>
Committed: Fri Sep 9 10:08:33 2016 -0700

----------------------------------------------------------------------
 .../drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/1887de29/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
----------------------------------------------------------------------
diff --git a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
index e38ad2d..fbb67de 100644
--- a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
+++ b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
@@ -86,11 +86,14 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
   private DocumentStream<DBDocument> documentStream;
 
   private Iterator<DocumentReader> documentReaderIterators;
+  
+  private boolean includeId;
 
   public MaprDBJsonRecordReader(MapRDBSubScanSpec subScanSpec,
       List<SchemaPath> projectedColumns, FragmentContext context) {
     buffer = context.getManagedBuffer();
     tableName = Preconditions.checkNotNull(subScanSpec, "MapRDB reader needs a sub-scan spec").getTableName();
+    includeId = false;
     condition = com.mapr.db.impl.ConditionImpl.parseFrom(ByteBufs.wrap(subScanSpec.getSerializedFilter()));
     setColumns(projectedColumns);
   }
@@ -120,6 +123,7 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
         if (column.getRootSegment().getPath().equalsIgnoreCase(ID_KEY)) {
           transformed.add(ID_PATH);
           projectedFieldsList.add(ID_FIELD);
+          includeId = true;
         } else {
           transformed.add(SchemaPath.getSimplePath(column.getRootSegment().getPath()));
           projectedFieldsList.add(FieldPath.parseFrom(column.getAsUnescapedPath()));
@@ -128,6 +132,7 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
       projectedFields = projectedFieldsList.toArray(new FieldPath[projectedFieldsList.size()]);
     } else {
       transformed.add(ID_PATH);
+      includeId = true;
     }
 
     return transformed;
@@ -167,7 +172,7 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
       }
       try {
         MapWriter map = writer.rootAsMap();
-        if (reader.getId() != null) {
+        if (includeId && reader.getId() != null) {
           switch (reader.getId().getType()) {
           case BINARY:
             writeBinary(map.varBinary(ID_KEY), reader.getId().getBinary());