Repository: drill Updated Branches: refs/heads/master c6a03eb17 -> d93a36338
DRILL-4442: Move getSV2 and getSV4 methods to VectorAccessible Up one level from previous location RecordBatch, most implementations already implement the method as they implement RecordBatch rather than VectorAccessible itself. Add unsupported operation exception to others. Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/01e04cdd Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/01e04cdd Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/01e04cdd Branch: refs/heads/master Commit: 01e04cddd6ad57f9ae146fe479e30bebcd7cc432 Parents: 1d1acc0 Author: Jason Altekruse <altekruseja...@gmail.com> Authored: Fri Feb 26 14:11:47 2016 -0800 Committer: Jason Altekruse <altekruseja...@gmail.com> Committed: Wed Apr 20 08:10:40 2016 -0700 ---------------------------------------------------------------------- .../impl/partitionsender/PartitionerTemplate.java | 10 ++++++++++ .../exec/physical/impl/window/WindowDataBatch.java | 12 ++++++++++++ .../drill/exec/physical/impl/xsort/BatchGroup.java | 11 +++++++++++ .../java/org/apache/drill/exec/record/RecordBatch.java | 5 ----- .../apache/drill/exec/record/RecordBatchLoader.java | 13 ++++++++++++- .../org/apache/drill/exec/record/RecordIterator.java | 12 ++++++++++++ .../org/apache/drill/exec/record/VectorAccessible.java | 8 ++++++++ .../org/apache/drill/exec/record/VectorContainer.java | 12 ++++++++++++ 8 files changed, 77 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/01e04cdd/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/partitionsender/PartitionerTemplate.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/partitionsender/PartitionerTemplate.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/partitionsender/PartitionerTemplate.java index 8fe0ab0..556460c 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/partitionsender/PartitionerTemplate.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/partitionsender/PartitionerTemplate.java @@ -399,6 +399,16 @@ public abstract class PartitionerTemplate implements Partitioner { return vectorContainer.iterator(); } + @Override + public SelectionVector2 getSelectionVector2() { + throw new UnsupportedOperationException(); + } + + @Override + public SelectionVector4 getSelectionVector4() { + throw new UnsupportedOperationException(); + } + public WritableBatch getWritableBatch() { return WritableBatch.getBatchNoHVWrap(recordCount, this, false); } http://git-wip-us.apache.org/repos/asf/drill/blob/01e04cdd/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/WindowDataBatch.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/WindowDataBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/WindowDataBatch.java index 7abc03c..7e9f115 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/WindowDataBatch.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/WindowDataBatch.java @@ -26,6 +26,8 @@ import org.apache.drill.exec.record.TypedFieldId; import org.apache.drill.exec.record.VectorAccessible; import org.apache.drill.exec.record.VectorContainer; import org.apache.drill.exec.record.VectorWrapper; +import org.apache.drill.exec.record.selection.SelectionVector2; +import org.apache.drill.exec.record.selection.SelectionVector4; import org.apache.drill.exec.vector.ValueVector; import java.util.Iterator; @@ -91,6 +93,16 @@ public class WindowDataBatch implements VectorAccessible { return container.iterator(); } + @Override + public SelectionVector2 getSelectionVector2() { + throw new UnsupportedOperationException(); + } + + @Override + public SelectionVector4 getSelectionVector4() { + throw new UnsupportedOperationException(); + } + public void clear() { container.clear(); } http://git-wip-us.apache.org/repos/asf/drill/blob/01e04cdd/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/BatchGroup.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/BatchGroup.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/BatchGroup.java index 5a3b305..0a818ee 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/BatchGroup.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/BatchGroup.java @@ -34,6 +34,7 @@ import org.apache.drill.exec.record.VectorContainer; import org.apache.drill.exec.record.VectorWrapper; import org.apache.drill.exec.record.WritableBatch; import org.apache.drill.exec.record.selection.SelectionVector2; +import org.apache.drill.exec.record.selection.SelectionVector4; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; @@ -210,4 +211,14 @@ public class BatchGroup implements VectorAccessible, AutoCloseable { return currentContainer.iterator(); } + @Override + public SelectionVector2 getSelectionVector2() { + throw new UnsupportedOperationException(); + } + + @Override + public SelectionVector4 getSelectionVector4() { + throw new UnsupportedOperationException(); + } + } http://git-wip-us.apache.org/repos/asf/drill/blob/01e04cdd/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java index 8229e58..04cf8fc 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java @@ -234,11 +234,6 @@ public interface RecordBatch extends VectorAccessible { */ public void kill(boolean sendUpstream); - public abstract SelectionVector2 getSelectionVector2(); - - public abstract SelectionVector4 getSelectionVector4(); - - public VectorContainer getOutgoingContainer(); /** http://git-wip-us.apache.org/repos/asf/drill/blob/01e04cdd/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java b/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java index 84c616b..ea99fcb 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java @@ -30,6 +30,8 @@ import org.apache.drill.exec.expr.TypeHelper; import org.apache.drill.exec.memory.BufferAllocator; import org.apache.drill.exec.proto.UserBitShared.RecordBatchDef; import org.apache.drill.exec.proto.UserBitShared.SerializedField; +import org.apache.drill.exec.record.selection.SelectionVector2; +import org.apache.drill.exec.record.selection.SelectionVector4; import org.apache.drill.exec.vector.AllocationHelper; import org.apache.drill.exec.vector.ValueVector; import org.slf4j.Logger; @@ -50,7 +52,6 @@ public class RecordBatchLoader implements VectorAccessible, Iterable<VectorWrapp private int valueCount; private BatchSchema schema; - /** * Constructs a loader using the given allocator for vector buffer allocation. */ @@ -188,6 +189,16 @@ public class RecordBatchLoader implements VectorAccessible, Iterable<VectorWrapp } @Override + public SelectionVector2 getSelectionVector2() { + throw new UnsupportedOperationException(); + } + + @Override + public SelectionVector4 getSelectionVector4() { + throw new UnsupportedOperationException(); + } + + @Override public BatchSchema getSchema() { return schema; } http://git-wip-us.apache.org/repos/asf/drill/blob/01e04cdd/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordIterator.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordIterator.java b/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordIterator.java index 918a8da..01acd7f 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordIterator.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordIterator.java @@ -27,6 +27,8 @@ import org.apache.drill.exec.record.RecordBatch.IterOutcome; import com.google.common.collect.Range; import com.google.common.collect.TreeRangeMap; +import org.apache.drill.exec.record.selection.SelectionVector2; +import org.apache.drill.exec.record.selection.SelectionVector4; /** * RecordIterator iterates over incoming record batches one record at a time. @@ -322,6 +324,16 @@ public class RecordIterator implements VectorAccessible { return container.iterator(); } + @Override + public SelectionVector2 getSelectionVector2() { + throw new UnsupportedOperationException(); + } + + @Override + public SelectionVector4 getSelectionVector4() { + throw new UnsupportedOperationException(); + } + // Release all vectors held by record batches, clear out range map. public void clear() { if (container != null) { http://git-wip-us.apache.org/repos/asf/drill/blob/01e04cdd/exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorAccessible.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorAccessible.java b/exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorAccessible.java index 6eb58c5..f1a250c 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorAccessible.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorAccessible.java @@ -18,6 +18,8 @@ package org.apache.drill.exec.record; import org.apache.drill.common.expression.SchemaPath; +import org.apache.drill.exec.record.selection.SelectionVector2; +import org.apache.drill.exec.record.selection.SelectionVector4; // TODO javadoc public interface VectorAccessible extends Iterable<VectorWrapper<?>> { @@ -50,4 +52,10 @@ public interface VectorAccessible extends Iterable<VectorWrapper<?>> { * @return number of records */ public int getRecordCount(); + + public abstract SelectionVector2 getSelectionVector2(); + + public abstract SelectionVector4 getSelectionVector4(); + + } http://git-wip-us.apache.org/repos/asf/drill/blob/01e04cdd/exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorContainer.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorContainer.java b/exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorContainer.java index 663cf22..96d9ba6 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorContainer.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorContainer.java @@ -31,6 +31,8 @@ import org.apache.drill.exec.expr.TypeHelper; import org.apache.drill.exec.memory.BufferAllocator; import org.apache.drill.exec.ops.OperatorContext; import org.apache.drill.exec.record.BatchSchema.SelectionVectorMode; +import org.apache.drill.exec.record.selection.SelectionVector2; +import org.apache.drill.exec.record.selection.SelectionVector4; import org.apache.drill.exec.vector.SchemaChangeCallBack; import org.apache.drill.exec.vector.ValueVector; @@ -345,6 +347,16 @@ public class VectorContainer implements Iterable<VectorWrapper<?>>, VectorAccess return recordCount; } + @Override + public SelectionVector2 getSelectionVector2() { + throw new UnsupportedOperationException(); + } + + @Override + public SelectionVector4 getSelectionVector4() { + throw new UnsupportedOperationException(); + } + /** * Clears the contained vectors. (See {@link ValueVector#clear}). */