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

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.Operator<T>
      extended by org.apache.hadoop.hive.ql.exec.TerminalOperator<ReduceSinkDesc>
          extended by org.apache.hadoop.hive.ql.exec.ReduceSinkOperator
All Implemented Interfaces:
Serializable, Cloneable, Node

public class ReduceSinkOperator
extends TerminalOperator<ReduceSinkDesc>
implements Serializable

Reduce Sink Operator sends output to the reduce stage.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.exec.Operator
Operator.OperatorFunc, Operator.ProgressCounter, Operator.State
 
Field Summary
protected  ExprNodeEvaluator[] keyEval
          The evaluators for the key columns.
protected  int numDistinctExprs
           
protected  int numDistributionKeys
           
protected  ExprNodeEvaluator[] partitionEval
          The evaluators for the partition columns (CLUSTER BY or DISTRIBUTE BY in Hive language).
protected  ExprNodeEvaluator[] valueEval
          The evaluators for the value columns.
 
Fields inherited from class org.apache.hadoop.hive.ql.exec.Operator
alias, beginTime, childOperators, childOperatorsArray, childOperatorsTag, colExprMap, conf, counterNames, counterNameToEnum, counters, done, fatalErrorCntr, groupKeyObject, id, inputObjInspectors, inputRows, isLogInfoEnabled, LOG, numInputRowsCntr, numOutputRowsCntr, operatorId, out, outputObjInspector, outputRows, parentOperators, reporter, state, statsMap, timeTakenCntr, totalTime
 
Constructor Summary
ReduceSinkOperator()
           
 
Method Summary
 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.
protected static StructObjectInspector initEvaluatorsAndReturnStruct(ExprNodeEvaluator[] evals, List<List<Integer>> distinctColIndices, List<String> outputColNames, int length, ObjectInspector rowInspector)
          Initializes array of ExprNodeEvaluator.
protected  void initializeOp(org.apache.hadoop.conf.Configuration hconf)
          Operator specific initialization.
 void processOp(Object row, int tag)
          Process the row.
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.Operator
allInitializedParentsAreClosed, areAllParentsInitialized, assignCounterNameToEnum, augmentPlan, checkFatalErrors, cleanUpInputFileChanged, cleanUpInputFileChangedOp, clone, close, closeOp, columnNamesRowResolvedCanBeObtained, dump, dump, endGroup, fatalErrorMessage, forward, getAdditionalCounters, getChildOperators, getChildren, getColumnExprMap, getConf, getCounterNames, getCounterNameToEnum, getCounters, getDone, getExecContext, getGroupKeyObject, getIdentifier, getInputObjInspectors, getOperatorId, getParentOperators, getSchema, getStats, getWrappedCounterName, incrCounter, initEvaluators, initEvaluators, initEvaluatorsAndReturnStruct, initialize, initializeChildren, initializeCounters, initializeLocalWork, initOperatorId, isUseBucketizedHiveInputFormat, jobClose, jobCloseOp, logStats, passExecContext, preorderMap, process, 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, startGroup, supportSkewJoinOptimization, supportUnionRemoveOptimization, updateCounters
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyEval

protected transient ExprNodeEvaluator[] keyEval
The evaluators for the key columns. Key columns decide the sort order on the reducer side. Key columns are passed to the reducer in the "key".


valueEval

protected transient ExprNodeEvaluator[] valueEval
The evaluators for the value columns. Value columns are passed to reducer in the "value".


partitionEval

protected transient ExprNodeEvaluator[] partitionEval
The evaluators for the partition columns (CLUSTER BY or DISTRIBUTE BY in Hive language). Partition columns decide the reducer that the current row goes to. Partition columns are not passed to reducer.


numDistributionKeys

protected transient int numDistributionKeys

numDistinctExprs

protected transient int numDistinctExprs
Constructor Detail

ReduceSinkOperator

public ReduceSinkOperator()
Method Detail

initializeOp

protected void initializeOp(org.apache.hadoop.conf.Configuration hconf)
                     throws HiveException
Description copied from class: Operator
Operator specific initialization.

Overrides:
initializeOp in class Operator<ReduceSinkDesc>
Throws:
HiveException

initEvaluatorsAndReturnStruct

protected static StructObjectInspector initEvaluatorsAndReturnStruct(ExprNodeEvaluator[] evals,
                                                                     List<List<Integer>> distinctColIndices,
                                                                     List<String> outputColNames,
                                                                     int length,
                                                                     ObjectInspector rowInspector)
                                                              throws HiveException
Initializes array of ExprNodeEvaluator. Adds Union field for distinct column indices for group by. Puts the return values into a StructObjectInspector with output column names. If distinctColIndices is empty, the object inspector is same as Operator.initEvaluatorsAndReturnStruct(ExprNodeEvaluator[], List, ObjectInspector)

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<ReduceSinkDesc>
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

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<ReduceSinkDesc>
Returns:
the name of the operator

getOperatorName

public static String getOperatorName()

getType

public 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<ReduceSinkDesc>
Returns:
OperatorType.*


Copyright © 2011 The Apache Software Foundation