DRILL-1312: Use correct index to get partition vectors in ScanBatch
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/c3e97fdf Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/c3e97fdf Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/c3e97fdf Branch: refs/heads/master Commit: c3e97fdfab67ff5d81d478e26534c3937fada07c Parents: a6d74f5 Author: Mehant Baid <meha...@gmail.com> Authored: Thu Aug 21 17:31:33 2014 -0700 Committer: Jacques Nadeau <jacq...@apache.org> Committed: Sun Aug 24 12:05:26 2014 -0700 ---------------------------------------------------------------------- .../java/org/apache/drill/exec/physical/impl/ScanBatch.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/c3e97fdf/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java index 9472627..e999c9a 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java @@ -224,9 +224,10 @@ public class ScanBatch implements RecordBatch { } private void populatePartitionVectors() { - for (int i : selectedPartitionColumns) { + for (int index = 0; index < selectedPartitionColumns.size(); index++) { + int i = selectedPartitionColumns.get(index); + NullableVarCharVector v = (NullableVarCharVector) partitionVectors.get(index); if (partitionValues.length > i) { - NullableVarCharVector v = (NullableVarCharVector) partitionVectors.get(i); String val = partitionValues[i]; AllocationHelper.allocate(v, recordCount, val.length()); NullableVarCharHolder h = new NullableVarCharHolder(); @@ -241,7 +242,6 @@ public class ScanBatch implements RecordBatch { } v.getMutator().setValueCount(recordCount); } else { - NullableVarCharVector v = (NullableVarCharVector) partitionVectors.get(i); AllocationHelper.allocate(v, recordCount, 0); v.getMutator().setValueCount(recordCount); }