You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ja...@apache.org on 2014/06/12 18:35:09 UTC

[18/24] git commit: DRILL-863: Sort column IDs in text reader

DRILL-863: Sort column IDs in text reader

Without this, if the columns passed to the reader are not in order, the reader does not read them correctly.


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

Branch: refs/heads/master
Commit: 930bc0f0bf06824c43563d8f1ed18b27e1f26c96
Parents: 2712c3c
Author: Steven Phillips <sp...@maprtech.com>
Authored: Wed Jun 11 02:14:56 2014 -0700
Committer: Jacques Nadeau <ja...@apache.org>
Committed: Wed Jun 11 21:25:15 2014 -0700

----------------------------------------------------------------------
 .../org/apache/drill/exec/store/text/DrillTextRecordReader.java    | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/930bc0f0/exec/java-exec/src/main/java/org/apache/drill/exec/store/text/DrillTextRecordReader.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/text/DrillTextRecordReader.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/text/DrillTextRecordReader.java
index 20f458f..b5b5b3c 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/text/DrillTextRecordReader.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/text/DrillTextRecordReader.java
@@ -18,6 +18,7 @@
 package org.apache.drill.exec.store.text;
 
 import java.io.IOException;
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.drill.common.exceptions.DrillRuntimeException;
@@ -79,6 +80,7 @@ public class DrillTextRecordReader implements RecordReader {
           columnIds.add(index);
         }
       }
+      Collections.sort(columnIds);
     }
     targetRecordCount = context.getConfig().getInt(ExecConstants.TEXT_LINE_READER_BATCH_SIZE);
     numCols = columnIds.size();