org.apache.hadoop.hive.ql.exec
Class GroupByOperator

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.Operator<GroupByDesc>
      extended by org.apache.hadoop.hive.ql.exec.GroupByOperator
All Implemented Interfaces:
Serializable, Cloneable, Node
Direct Known Subclasses:
VectorGroupByOperator

public class GroupByOperator
extends Operator<GroupByDesc>
implements Serializable

GroupBy operator implementation.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.exec.Operator
Operator.OperatorFunc, Operator.State
 
Field Summary
static MemoryMXBean memoryMXBean
           
 
Fields inherited from class org.apache.hadoop.hive.ql.exec.Operator
HIVECOUNTERCREATEDFILES, HIVECOUNTERFATAL
 
Constructor Summary
GroupByOperator()
           
 
Method Summary
 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.
 List<String> genColLists(HashMap<Operator<? extends OperatorDesc>,OpParseContext> opParseCtx)
           
 String getName()
          Implements the getName function for the Node Interface.
static String getOperatorName()
           
 org.apache.hadoop.hive.ql.plan.api.OperatorType getType()
          Return the type of the specific operator among the types in OperatorType.
static javolution.util.FastBitSet groupingSet2BitSet(int value)
           
 void processOp(Object row, int tag)
          Process the row.
 void startGroup()
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.Operator
augmentPlan, cleanUpInputFileChanged, cleanUpInputFileChangedOp, clone, cloneOp, cloneRecursiveChildren, close, columnNamesRowResolvedCanBeObtained, dump, dump, getChildOperators, getChildren, getColumnExprMap, getConf, getConfiguration, getDone, getExecContext, getGroupKeyObject, getGroupKeyObjectInspector, getIdentifier, getInputObjInspectors, getNumChild, getNumParent, getOperatorId, getOpTraits, getOutputObjInspector, getParentOperators, getSchema, getStatistics, getStats, initialize, 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, setExecContext, setGroupKeyObject, setGroupKeyObjectInspector, setId, setInputObjInspectors, setOperatorId, setOpTraits, setOutputCollector, setParentOperators, setReporter, setSchema, setStatistics, setUseBucketizedHiveInputFormat, supportAutomaticSortMergeJoin, supportSkewJoinOptimization, supportUnionRemoveOptimization, toString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

memoryMXBean

public static MemoryMXBean memoryMXBean
Constructor Detail

GroupByOperator

public GroupByOperator()
Method Detail

groupingSet2BitSet

public static javolution.util.FastBitSet groupingSet2BitSet(int value)

startGroup

public void startGroup()
                throws HiveException
Overrides:
startGroup in class Operator<GroupByDesc>
Throws:
HiveException

endGroup

public void endGroup()
              throws HiveException
Overrides:
endGroup in class Operator<GroupByDesc>
Throws:
HiveException

processOp

public void processOp(Object row,
                      int tag)
               throws HiveException
Description copied from class: Operator
Process the row.

Specified by:
processOp in class Operator<GroupByDesc>
Parameters:
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.
Throws:
HiveException

flush

public void flush()
           throws HiveException
Forward all aggregations to children. It is only used by DemuxOperator.

Overrides:
flush in class Operator<GroupByDesc>
Throws:
HiveException

closeOp

public void closeOp(boolean abort)
             throws HiveException
We need to forward all the aggregations to children.

Throws:
HiveException

genColLists

public List<String> genColLists(HashMap<Operator<? extends OperatorDesc>,OpParseContext> opParseCtx)

getName

public String getName()
Description copied from class: Operator
Implements the getName function for the Node Interface.

Specified by:
getName in interface Node
Overrides:
getName in class Operator<GroupByDesc>
Returns:
the name of the operator

getOperatorName

public static String getOperatorName()

getType

public org.apache.hadoop.hive.ql.plan.api.OperatorType getType()
Description copied from class: Operator
Return the type of the specific operator among the types in OperatorType.

Specified by:
getType in class Operator<GroupByDesc>
Returns:
OperatorType.*

acceptLimitPushdown

public boolean acceptLimitPushdown()
we can push the limit above GBY (running in Reducer), since that will generate single row for each group. This doesn't necessarily hold for GBY (running in Mappers), so we don't push limit above it.

Overrides:
acceptLimitPushdown in class Operator<GroupByDesc>


Copyright © 2014 The Apache Software Foundation. All rights reserved.