Class HashAggTemplate
java.lang.Object
org.apache.drill.exec.physical.impl.aggregate.HashAggTemplate
- All Implemented Interfaces:
HashAggregator
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
static enum
Nested classes/interfaces inherited from interface org.apache.drill.exec.physical.impl.aggregate.HashAggregator
HashAggregator.AggIterOutcome, HashAggregator.AggOutcome
-
Field Summary
Modifier and TypeFieldDescriptionprotected ClassGenerator<?>
protected FragmentContext
protected static final org.slf4j.Logger
Fields inherited from interface org.apache.drill.exec.physical.impl.aggregate.HashAggregator
TEMPLATE_DEFINITION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
adjustOutputCount
(int outputBatchSize, int oldRowWidth, int newRowWidth) boolean
boolean
void
cleanup()
abstract void
doSetup
(RecordBatch incoming) doWork()
Read and process (i.e., insert into the hash table and aggregate) records from the current batch.boolean
get new incoming: (when reading spilled files like an "incoming")int
abstract int
getVectorIndex
(int recordIndex) boolean
protected HashAggTemplate.BatchHolder
injectMembers
(HashAggTemplate.BatchHolder batchHolder) protected HashAggTemplate.BatchHolder
newBatchHolder
(int batchRowCount) int
Output the next batch from partition "nextPartitionToReturn"abstract boolean
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) 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:
setup
in interfaceHashAggregator
-
getNewIncoming
get new incoming: (when reading spilled files like an "incoming")- Specified by:
getNewIncoming
in 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:
doWork
in interfaceHashAggregator
- Returns:
- Agg outcome status
-
getOutcome
- Specified by:
getOutcome
in interfaceHashAggregator
-
getOutputCount
public int getOutputCount()- Specified by:
getOutputCount
in interfaceHashAggregator
-
adjustOutputCount
public void adjustOutputCount(int outputBatchSize, int oldRowWidth, int newRowWidth) - Specified by:
adjustOutputCount
in interfaceHashAggregator
-
cleanup
public void cleanup()- Specified by:
cleanup
in interfaceHashAggregator
-
newBatchHolder
-
injectMembers
-
outputCurrentBatch
Output the next batch from partition "nextPartitionToReturn"- Specified by:
outputCurrentBatch
in interfaceHashAggregator
- Returns:
- iteration outcome (e.g., OK, NONE ...)
-
allFlushed
public boolean allFlushed()- Specified by:
allFlushed
in interfaceHashAggregator
-
buildComplete
public boolean buildComplete()- Specified by:
buildComplete
in interfaceHashAggregator
-
handlingEmit
public boolean handlingEmit()- Specified by:
handlingEmit
in interfaceHashAggregator
-
earlyOutput
public boolean earlyOutput()- Specified by:
earlyOutput
in 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
-