public class GroupByOperator extends Operator<GroupByDesc>
Operator.OperatorFunc, Operator.State
Modifier and Type | Field and Description |
---|---|
static int |
javaHashEntryOverHead |
static int |
javaObjectOverHead |
static int |
javaSizePrimitiveType |
static int |
javaSizeUnknownType |
protected long |
maxHashTblMemory
Max memory usable by the hashtable before it should flush.
|
protected long |
maxMemory
Total amount of memory allowed for JVM heap.
|
protected float |
memoryThreshold
configure percent of memory threshold usable by QP.
|
protected int |
numEntriesHashTable
Current number of entries in the hash table.
|
alias, childOperators, childOperatorsArray, childOperatorsTag, colExprMap, conf, CONTEXT_NAME_KEY, done, groupKeyObject, HIVECOUNTERCREATEDFILES, HIVECOUNTERFATAL, id, inputObjInspectors, isLogDebugEnabled, isLogInfoEnabled, isLogTraceEnabled, LOG, operatorId, out, outputObjInspector, parentOperators, PLOG, reporter, state, statsMap
Constructor and Description |
---|
GroupByOperator() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptLimitPushdown()
we can push the limit above GBY (running in Reducer), since that will generate single row
for each group.
|
void |
closeOp(boolean abort)
We need to forward all the aggregations to children.
|
void |
flush()
Forward all aggregations to children.
|
List<String> |
genColLists(HashMap<Operator<? extends OperatorDesc>,OpParseContext> opParseCtx) |
String |
getName()
Implements the getName function for the Node Interface.
|
static String |
getOperatorName() |
OperatorType |
getType()
Return the type of the specific operator among the
types in OperatorType.
|
static javolution.util.FastBitSet |
groupingSet2BitSet(int value) |
protected Collection<Future<?>> |
initializeOp(org.apache.hadoop.conf.Configuration hconf)
Operator specific initialization.
|
protected GenericUDAFEvaluator.AggregationBuffer[] |
newAggregations() |
void |
process(Object row,
int tag)
Process the row.
|
protected void |
resetAggregations(GenericUDAFEvaluator.AggregationBuffer[] aggs) |
protected void |
updateAggregations(GenericUDAFEvaluator.AggregationBuffer[] aggs,
Object row,
ObjectInspector rowInspector,
boolean hashAggr,
boolean newEntryForHashAggr,
Object[][] lastInvoke) |
allInitializedParentsAreClosed, areAllParentsInitialized, augmentPlan, cleanUpInputFileChanged, cleanUpInputFileChangedOp, clone, cloneOp, cloneRecursiveChildren, close, columnNamesRowResolvedCanBeObtained, completeInitializationOp, createDummy, defaultEndGroup, defaultStartGroup, dump, dump, endGroup, forward, getAdditionalCounters, getChildOperators, getChildren, getColumnExprMap, getConf, getConfiguration, getDone, getExecContext, getGroupKeyObject, getIdentifier, getInputObjInspectors, getNextCntr, getNumChild, getNumParent, getOperatorId, getOpTraits, getOutputObjInspector, getParentOperators, getSchema, getStatistics, getStats, initEvaluators, initEvaluators, initEvaluatorsAndReturnStruct, initialize, initialize, initializeChildren, initializeLocalWork, initOperatorId, isUseBucketizedHiveInputFormat, jobClose, jobCloseOp, logStats, opAllowedAfterMapJoin, opAllowedBeforeMapJoin, opAllowedBeforeSortMergeJoin, opAllowedConvertMapJoin, passExecContext, preorderMap, processGroup, removeChild, removeChildAndAdoptItsChildren, removeChildren, removeParent, replaceChild, replaceParent, reset, resetId, resetStats, setAlias, setChildOperators, setColumnExprMap, setConf, setDone, setExecContext, setGroupKeyObject, setId, setInputContext, setInputObjInspectors, setOperatorId, setOpTraits, setOutputCollector, setParentOperators, setReporter, setSchema, setStatistics, setUseBucketizedHiveInputFormat, startGroup, supportAutomaticSortMergeJoin, supportSkewJoinOptimization, supportUnionRemoveOptimization, toString, toString
protected transient long maxMemory
protected transient long maxHashTblMemory
protected transient float memoryThreshold
protected transient int numEntriesHashTable
public static final int javaObjectOverHead
public static final int javaHashEntryOverHead
public static final int javaSizePrimitiveType
public static final int javaSizeUnknownType
public static javolution.util.FastBitSet groupingSet2BitSet(int value)
protected Collection<Future<?>> initializeOp(org.apache.hadoop.conf.Configuration hconf) throws HiveException
Operator
initializeOp
in class Operator<GroupByDesc>
HiveException
protected GenericUDAFEvaluator.AggregationBuffer[] newAggregations() throws HiveException
HiveException
protected void resetAggregations(GenericUDAFEvaluator.AggregationBuffer[] aggs) throws HiveException
HiveException
protected void updateAggregations(GenericUDAFEvaluator.AggregationBuffer[] aggs, Object row, ObjectInspector rowInspector, boolean hashAggr, boolean newEntryForHashAggr, Object[][] lastInvoke) throws HiveException
HiveException
public void process(Object row, int tag) throws HiveException
Operator
process
in class Operator<GroupByDesc>
row
- The object representing the row.tag
- The tag of the row usually means which parent this row comes from.
Rows with the same tag should have exactly the same rowInspector
all the time.HiveException
public void flush() throws HiveException
flush
in class Operator<GroupByDesc>
HiveException
public void closeOp(boolean abort) throws HiveException
closeOp
in class Operator<GroupByDesc>
HiveException
public List<String> genColLists(HashMap<Operator<? extends OperatorDesc>,OpParseContext> opParseCtx)
public String getName()
Operator
getName
in interface Node
getName
in class Operator<GroupByDesc>
public static String getOperatorName()
public OperatorType getType()
Operator
getType
in class Operator<GroupByDesc>
public boolean acceptLimitPushdown()
acceptLimitPushdown
in class Operator<GroupByDesc>
Copyright © 2017 The Apache Software Foundation. All rights reserved.