public class GroupByOperator extends Operator<GroupByDesc> implements java.io.Serializable
Operator.OperatorFunc, Operator.ProgressCounter, Operator.Statealias, 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, updateCounterspublic 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
OperatorinitializeOp in class Operator<GroupByDesc>HiveExceptionprotected GenericUDAFEvaluator.AggregationBuffer[] newAggregations() throws HiveException
HiveExceptionprotected void resetAggregations(GenericUDAFEvaluator.AggregationBuffer[] aggs) throws HiveException
HiveExceptionprotected void updateAggregations(GenericUDAFEvaluator.AggregationBuffer[] aggs, java.lang.Object row, ObjectInspector rowInspector, boolean hashAggr, boolean newEntryForHashAggr, java.lang.Object[][] lastInvoke) throws HiveException
HiveExceptionpublic void startGroup()
throws HiveException
startGroup in class Operator<GroupByDesc>HiveExceptionpublic void endGroup()
throws HiveException
endGroup in class Operator<GroupByDesc>HiveExceptionpublic void processOp(java.lang.Object row,
int tag)
throws HiveException
OperatorprocessOp 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.HiveExceptionprotected void forward(java.lang.Object[] keys,
GenericUDAFEvaluator.AggregationBuffer[] aggs)
throws HiveException
keys - The keys in the recordHiveExceptionpublic void flush()
throws HiveException
flush in class Operator<GroupByDesc>HiveExceptionpublic void closeOp(boolean abort)
throws HiveException
closeOp in class Operator<GroupByDesc>HiveExceptionprotected 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()
OperatorgetName in interface NodegetName in class Operator<GroupByDesc>public static java.lang.String getOperatorName()
public OperatorType getType()
OperatorgetType in class Operator<GroupByDesc>public boolean acceptLimitPushdown()
acceptLimitPushdown in class Operator<GroupByDesc>Copyright © 2012 The Apache Software Foundation