Class HashAggTemplate
java.lang.Object
org.apache.drill.exec.physical.impl.aggregate.HashAggTemplate
- All Implemented Interfaces:
HashAggregator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassstatic enumNested classes/interfaces inherited from interface org.apache.drill.exec.physical.impl.aggregate.HashAggregator
HashAggregator.AggIterOutcome, HashAggregator.AggOutcome -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClassGenerator<?> protected FragmentContextprotected static final org.slf4j.LoggerFields inherited from interface org.apache.drill.exec.physical.impl.aggregate.HashAggregator
TEMPLATE_DEFINITION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustOutputCount(int outputBatchSize, int oldRowWidth, int newRowWidth) booleanbooleanvoidcleanup()abstract voiddoSetup(RecordBatch incoming) doWork()Read and process (i.e., insert into the hash table and aggregate) records from the current batch.booleanget new incoming: (when reading spilled files like an "incoming")intabstract intgetVectorIndex(int recordIndex) booleanprotected HashAggTemplate.BatchHolderinjectMembers(HashAggTemplate.BatchHolder batchHolder) protected HashAggTemplate.BatchHoldernewBatchHolder(int batchRowCount) intOutput the next batch from partition "nextPartitionToReturn"abstract booleanvoidsetup(HashAggregate hashAggrConfig, HashTableConfig htConfig, FragmentContext context, OperatorContext oContext, RecordBatch incoming, HashAggBatch outgoing, LogicalExpression[] valueExprs, List<TypedFieldId> valueFieldIds, ClassGenerator<?> cg, TypedFieldId[] groupByOutFieldIds, VectorContainer outContainer, int extraRowBytes) toString()
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
context
-
cg
-
-
Constructor Details
-
HashAggTemplate
public HashAggTemplate()
-
-
Method Details
-
setup
public void setup(HashAggregate hashAggrConfig, HashTableConfig htConfig, FragmentContext context, OperatorContext oContext, RecordBatch incoming, HashAggBatch outgoing, LogicalExpression[] valueExprs, List<TypedFieldId> valueFieldIds, ClassGenerator<?> cg, TypedFieldId[] groupByOutFieldIds, VectorContainer outContainer, int extraRowBytes) - Specified by:
setupin interfaceHashAggregator
-
getNewIncoming
get new incoming: (when reading spilled files like an "incoming")- Specified by:
getNewIncomingin interfaceHashAggregator- Returns:
- The (newly replaced) incoming
-
doWork
Read and process (i.e., insert into the hash table and aggregate) records from the current batch. Once complete, get the incoming NEXT batch and process it as well, etc. For 1st phase, may return when an early output needs to be performed.- Specified by:
doWorkin interfaceHashAggregator- Returns:
- Agg outcome status
-
getOutcome
- Specified by:
getOutcomein interfaceHashAggregator
-
getOutputCount
public int getOutputCount()- Specified by:
getOutputCountin interfaceHashAggregator
-
adjustOutputCount
public void adjustOutputCount(int outputBatchSize, int oldRowWidth, int newRowWidth) - Specified by:
adjustOutputCountin interfaceHashAggregator
-
cleanup
public void cleanup()- Specified by:
cleanupin interfaceHashAggregator
-
newBatchHolder
-
injectMembers
-
outputCurrentBatch
Output the next batch from partition "nextPartitionToReturn"- Specified by:
outputCurrentBatchin interfaceHashAggregator- Returns:
- iteration outcome (e.g., OK, NONE ...)
-
allFlushed
public boolean allFlushed()- Specified by:
allFlushedin interfaceHashAggregator
-
buildComplete
public boolean buildComplete()- Specified by:
buildCompletein interfaceHashAggregator
-
handlingEmit
public boolean handlingEmit()- Specified by:
handlingEmitin interfaceHashAggregator
-
earlyOutput
public boolean earlyOutput()- Specified by:
earlyOutputin interfaceHashAggregator
-
numGroupedRecords
public int numGroupedRecords() -
toString
-
doSetup
- Throws:
SchemaChangeException
-
getVectorIndex
public abstract int getVectorIndex(@Named("recordIndex") int recordIndex) throws SchemaChangeException - Throws:
SchemaChangeException
-
resetValues
- Throws:
SchemaChangeException
-