Class OrderedPartitionRecordBatch
java.lang.Object
org.apache.drill.exec.record.AbstractRecordBatch<OrderedPartitionSender>
org.apache.drill.exec.physical.impl.orderedpartitioner.OrderedPartitionRecordBatch
- All Implemented Interfaces:
AutoCloseable
,Iterable<VectorWrapper<?>>
,CloseableRecordBatch
,RecordBatch
,VectorAccessible
Generates an ordered partition, rather than a random hash partition. This
could be used to do a total order sort, for example. This operator reads in a
few incoming record batches, samples these batches, and stores them in the
distributed cache. The samples from all the parallel-running fragments are
merged, and a partition-table is built and stored in the distributed cache
for use by all fragments. A new column is added to the outgoing batch, whose
value is determined by where each record falls in the partition table. This
column is used by PartitionSenderRootExec to determine which bucket to assign
each record to.
This code is not used.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.record.AbstractRecordBatch
AbstractRecordBatch.BatchState
Nested classes/interfaces inherited from interface org.apache.drill.exec.record.RecordBatch
RecordBatch.IterOutcome
-
Field Summary
Modifier and TypeFieldDescriptionprotected final RecordBatch
static final DistributedCache.CacheConfig<String,
CachedVectorContainer> static final DistributedCache.CacheConfig<String,
CachedVectorContainer> Fields inherited from class org.apache.drill.exec.record.AbstractRecordBatch
batchStatsContext, container, context, oContext, popConfig, state, stats, unionTypeEnabled
Fields inherited from interface org.apache.drill.exec.record.RecordBatch
MAX_BATCH_ROW_COUNT
-
Constructor Summary
ConstructorDescriptionOrderedPartitionRecordBatch
(OrderedPartitionSender pop, RecordBatch incoming, FragmentContext context) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
close()
protected void
doWork
(VectorAccessible batch) void
dump()
Perform dump of this batch's state to logs.int
Get the number of records.protected void
setupNewSchema
(VectorAccessible batch) Sets up projection that will transfer all of the columns in batch, and also populate the partition column based on which partition a record falls into in the partition tableMethods inherited from class org.apache.drill.exec.record.AbstractRecordBatch
buildSchema, cancel, checkContinue, getContainer, getContext, getOutgoingContainer, getPopConfig, getRecordBatchStatsContext, getSchema, getSelectionVector2, getSelectionVector4, getValueAccessorById, getValueVectorId, getWritableBatch, isRecordBatchStatsLoggingEnabled, iterator, next, next, next, schemaChangeException, schemaChangeException
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
SINGLE_CACHE_CONFIG
-
MULTI_CACHE_CONFIG
-
incoming
-
-
Constructor Details
-
OrderedPartitionRecordBatch
public OrderedPartitionRecordBatch(OrderedPartitionSender pop, RecordBatch incoming, FragmentContext context) throws OutOfMemoryException - Throws:
OutOfMemoryException
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Overrides:
close
in classAbstractRecordBatch<OrderedPartitionSender>
-
cancelIncoming
protected void cancelIncoming()- Specified by:
cancelIncoming
in classAbstractRecordBatch<OrderedPartitionSender>
-
innerNext
- Specified by:
innerNext
in classAbstractRecordBatch<OrderedPartitionSender>
-
getRecordCount
public int getRecordCount()Description copied from interface:VectorAccessible
Get the number of records.- Returns:
- number of records
-
doWork
-
setupNewSchema
Sets up projection that will transfer all of the columns in batch, and also populate the partition column based on which partition a record falls into in the partition table- Parameters:
batch
-
-
dump
public void dump()Description copied from interface:RecordBatch
Perform dump of this batch's state to logs.
-