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.BatchStateNested classes/interfaces inherited from interface org.apache.drill.exec.record.RecordBatch
RecordBatch.IterOutcome -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final RecordBatchstatic 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, unionTypeEnabledFields inherited from interface org.apache.drill.exec.record.RecordBatch
MAX_BATCH_ROW_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionOrderedPartitionRecordBatch(OrderedPartitionSender pop, RecordBatch incoming, FragmentContext context) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidclose()protected voiddoWork(VectorAccessible batch) voiddump()Perform dump of this batch's state to logs.intGet the number of records.protected voidsetupNewSchema(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, schemaChangeExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
closein interfaceAutoCloseable- Overrides:
closein classAbstractRecordBatch<OrderedPartitionSender>
-
cancelIncoming
protected void cancelIncoming()- Specified by:
cancelIncomingin classAbstractRecordBatch<OrderedPartitionSender>
-
innerNext
- Specified by:
innerNextin classAbstractRecordBatch<OrderedPartitionSender>
-
getRecordCount
public int getRecordCount()Description copied from interface:VectorAccessibleGet 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:RecordBatchPerform dump of this batch's state to logs.
-