public class GroupByOperator extends Operator<GroupByDesc> implements java.io.Serializable
Operator.OperatorFunc, Operator.ProgressCounter, Operator.State
alias, beginTime, childOperators, childOperatorsArray, childOperatorsTag, colExprMap, conf, counterNames, counterNameToEnum, counters, done, fatalErrorCntr, groupKeyObject, id, inputObjInspectors, inputRows, isLogInfoEnabled, numInputRowsCntr, numOutputRowsCntr, operatorId, out, outputObjInspector, outputRows, parentOperators, reporter, state, statsMap, timeTakenCntr, totalTime
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 |
endGroup() |
void |
flush()
Forward all aggregations to children.
|
protected void |
forward(java.lang.Object[] keys,
GenericUDAFEvaluator.AggregationBuffer[] aggs)
Forward a record of keys and aggregation results.
|
java.util.List<java.lang.String> |
genColLists(java.util.HashMap<Operator<? extends OperatorDesc>,OpParseContext> opParseCtx) |
protected java.util.List<java.lang.String> |
getAdditionalCounters() |
java.lang.String |
getName()
Implements the getName function for the Node Interface.
|
static java.lang.String |
getOperatorName() |
OperatorType |
getType()
Return the type of the specific operator among the
types in OperatorType.
|
static javolution.util.FastBitSet |
groupingSet2BitSet(int value) |
protected void |
initializeOp(Configuration hconf)
Operator specific initialization.
|
protected GenericUDAFEvaluator.AggregationBuffer[] |
newAggregations() |
void |
processOp(java.lang.Object row,
int tag)
Process the row.
|
protected void |
resetAggregations(GenericUDAFEvaluator.AggregationBuffer[] aggs) |
void |
startGroup() |
protected void |
updateAggregations(GenericUDAFEvaluator.AggregationBuffer[] aggs,
java.lang.Object row,
ObjectInspector rowInspector,
boolean hashAggr,
boolean newEntryForHashAggr,
java.lang.Object[][] lastInvoke) |
allInitializedParentsAreClosed, areAllParentsInitialized, assignCounterNameToEnum, augmentPlan, checkFatalErrors, cleanUpInputFileChanged, cleanUpInputFileChangedOp, clone, close, columnNamesRowResolvedCanBeObtained, dump, dump, fatalErrorMessage, forward, getChildOperators, getChildren, getColumnExprMap, getConf, getConfiguration, getCounterNames, getCounterNameToEnum, getCounters, getDone, getExecContext, getGroupKeyObject, getIdentifier, getInputObjInspectors, getNextCntr, getNumChild, getNumParent, getOperatorId, getParentOperators, getSchema, getStats, getWrappedCounterName, incrCounter, initEvaluators, initEvaluators, initEvaluatorsAndReturnStruct, initialize, initialize, initializeChildren, initializeCounters, initializeLocalWork, initOperatorId, isUseBucketizedHiveInputFormat, jobClose, jobCloseOp, logStats, opAllowedAfterMapJoin, opAllowedBeforeMapJoin, opAllowedBeforeSortMergeJoin, opAllowedConvertMapJoin, passExecContext, preorderMap, process, processGroup, removeChild, removeChildAndAdoptItsChildren, removeChildren, removeParent, replaceChild, replaceParent, reset, resetId, resetLastEnumUsed, resetStats, setAlias, setChildOperators, setColumnExprMap, setConf, setCounterNames, setCounterNameToEnum, setDone, setExecContext, setGroupKeyObject, setId, setInputObjInspectors, setOperatorId, setOutputCollector, setParentOperators, setReporter, setSchema, setUseBucketizedHiveInputFormat, supportAutomaticSortMergeJoin, supportSkewJoinOptimization, supportUnionRemoveOptimization, toString, toString, updateCounters
public static final java.lang.String counterNameHashOut
protected transient ExprNodeEvaluator[] keyFields
protected transient ObjectInspector[] keyObjectInspectors
protected transient ExprNodeEvaluator[][] aggregationParameterFields
protected transient ObjectInspector[][] aggregationParameterObjectInspectors
protected transient ObjectInspector[][] aggregationParameterStandardObjectInspectors
protected transient java.lang.Object[][] aggregationParameterObjects
protected transient boolean[] aggregationIsDistinct
protected transient java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> distinctKeyAggrs
protected transient java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> nonDistinctKeyAggrs
protected transient java.util.List<java.lang.Integer> nonDistinctAggrs
protected transient java.util.ArrayList<ObjectInspector> objectInspectors
protected transient KeyWrapper currentKeys
protected transient KeyWrapper newKeys
protected transient GenericUDAFEvaluator.AggregationBuffer[] aggregations
protected transient java.lang.Object[][] aggregationsParametersLastInvoke
protected transient java.util.HashMap<KeyWrapper,GenericUDAFEvaluator.AggregationBuffer[]> hashAggregations
protected transient java.util.HashSet<KeyWrapper> keysCurrentGroup
protected transient ObjectInspector[] currentKeyObjectInspectors
public static java.lang.management.MemoryMXBean memoryMXBean
public static javolution.util.FastBitSet groupingSet2BitSet(int value)
protected void initializeOp(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, java.lang.Object row, ObjectInspector rowInspector, boolean hashAggr, boolean newEntryForHashAggr, java.lang.Object[][] lastInvoke) throws HiveException
HiveException
public void startGroup() throws HiveException
startGroup
in class Operator<GroupByDesc>
HiveException
public void endGroup() throws HiveException
endGroup
in class Operator<GroupByDesc>
HiveException
public void processOp(java.lang.Object row, int tag) throws HiveException
Operator
processOp
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
protected void forward(java.lang.Object[] keys, GenericUDAFEvaluator.AggregationBuffer[] aggs) throws HiveException
keys
- The keys in the recordHiveException
public void flush() throws HiveException
flush
in class Operator<GroupByDesc>
HiveException
public void closeOp(boolean abort) throws HiveException
closeOp
in class Operator<GroupByDesc>
HiveException
protected java.util.List<java.lang.String> getAdditionalCounters()
getAdditionalCounters
in class Operator<GroupByDesc>
public java.util.List<java.lang.String> genColLists(java.util.HashMap<Operator<? extends OperatorDesc>,OpParseContext> opParseCtx)
public java.lang.String getName()
Operator
getName
in interface Node
getName
in class Operator<GroupByDesc>
public static java.lang.String getOperatorName()
public OperatorType getType()
Operator
getType
in class Operator<GroupByDesc>
public boolean acceptLimitPushdown()
acceptLimitPushdown
in class Operator<GroupByDesc>
Copyright © 2012 The Apache Software Foundation