public class ReduceSinkOperator extends TerminalOperator<ReduceSinkDesc> implements Serializable, TopNHash.BinaryCollector
Modifier and Type | Class and Description |
---|---|
static class |
ReduceSinkOperator.Counter
Counters.
|
Operator.OperatorFunc, Operator.State
Modifier and Type | Field and Description |
---|---|
protected ExprNodeEvaluator[] |
bucketEval
Evaluators for bucketing columns.
|
protected int |
bucketNumber |
protected Object[][] |
cachedKeys
This two dimensional array holds key data and a corresponding Union object
which contains the tag identifying the aggregate expression for distinct columns.
|
protected Object[] |
cachedValues |
protected long |
cntr |
protected List<List<Integer>> |
distinctColIndices |
protected String[] |
inputAliases |
protected ExprNodeEvaluator[] |
keyEval
The evaluators for the key columns.
|
protected boolean |
keyIsText |
protected ObjectInspector |
keyObjectInspector |
protected Serializer |
keySerializer |
protected HiveKey |
keyWritable |
protected long |
logEveryNRows |
protected int |
numDistinctExprs |
protected int |
numDistributionKeys |
protected long |
numRows |
protected org.apache.hadoop.mapred.OutputCollector |
out |
protected ExprNodeEvaluator[] |
partitionEval
The evaluators for the partition columns (CLUSTER BY or DISTRIBUTE BY in
Hive language).
|
protected Random |
random |
protected TopNHash |
reducerHash |
protected byte[] |
tagByte |
protected boolean |
useUniformHash |
protected ExprNodeEvaluator[] |
valueEval
The evaluators for the value columns.
|
protected ObjectInspector |
valueObjectInspector |
protected Serializer |
valueSerializer |
alias, childOperators, childOperatorsArray, childOperatorsTag, colExprMap, conf, CONTEXT_NAME_KEY, done, groupKeyObject, HIVECOUNTERCREATEDFILES, HIVECOUNTERFATAL, id, inputObjInspectors, isLogDebugEnabled, isLogInfoEnabled, isLogTraceEnabled, LOG, operatorId, outputObjInspector, parentOperators, PLOG, reporter, state, statsMap
Constructor and Description |
---|
ReduceSinkOperator() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeOp(boolean abort)
Operator specific close routine.
|
void |
collect(byte[] key,
byte[] value,
int hash) |
protected void |
collect(org.apache.hadoop.io.BytesWritable keyWritable,
org.apache.hadoop.io.Writable valueWritable) |
protected int |
computeMurmurHash(HiveKey firstKey) |
String[] |
getInputAliases() |
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.
|
int[] |
getValueIndex() |
protected static StructObjectInspector |
initEvaluatorsAndReturnStruct(ExprNodeEvaluator[] evals,
List<List<Integer>> distinctColIndices,
List<String> outputColNames,
int length,
ObjectInspector rowInspector)
Initializes array of ExprNodeEvaluator.
|
protected Collection<Future<?>> |
initializeOp(org.apache.hadoop.conf.Configuration hconf)
Operator specific initialization.
|
boolean |
opAllowedBeforeMapJoin() |
void |
process(Object row,
int tag)
Process the row.
|
void |
setInputAliases(String[] inputAliases) |
void |
setOutputCollector(org.apache.hadoop.mapred.OutputCollector _out) |
void |
setSkipTag(boolean value) |
void |
setValueIndex(int[] valueIndex) |
protected HiveKey |
toHiveKey(Object obj,
int tag,
Integer distLength) |
acceptLimitPushdown, allInitializedParentsAreClosed, areAllParentsInitialized, augmentPlan, cleanUpInputFileChanged, cleanUpInputFileChangedOp, clone, cloneOp, cloneRecursiveChildren, close, columnNamesRowResolvedCanBeObtained, completeInitializationOp, createDummy, defaultEndGroup, defaultStartGroup, dump, dump, endGroup, flush, 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, 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, setParentOperators, setReporter, setSchema, setStatistics, setUseBucketizedHiveInputFormat, startGroup, supportAutomaticSortMergeJoin, supportSkewJoinOptimization, supportUnionRemoveOptimization, toString, toString
protected transient org.apache.hadoop.mapred.OutputCollector out
protected transient ExprNodeEvaluator[] keyEval
protected transient ExprNodeEvaluator[] valueEval
protected transient ExprNodeEvaluator[] partitionEval
protected transient ExprNodeEvaluator[] bucketEval
protected transient Serializer keySerializer
protected transient boolean keyIsText
protected transient Serializer valueSerializer
protected transient byte[] tagByte
protected transient int numDistributionKeys
protected transient int numDistinctExprs
protected transient String[] inputAliases
protected transient boolean useUniformHash
protected transient TopNHash reducerHash
protected transient HiveKey keyWritable
protected transient ObjectInspector keyObjectInspector
protected transient ObjectInspector valueObjectInspector
protected transient Object[] cachedValues
protected transient Random random
protected transient int bucketNumber
protected transient Object[][] cachedKeys
ExprNodeColumnEvaluator
protected transient long numRows
protected transient long cntr
protected transient long logEveryNRows
protected Collection<Future<?>> initializeOp(org.apache.hadoop.conf.Configuration hconf) throws HiveException
Operator
initializeOp
in class Operator<ReduceSinkDesc>
HiveException
protected static StructObjectInspector initEvaluatorsAndReturnStruct(ExprNodeEvaluator[] evals, List<List<Integer>> distinctColIndices, List<String> outputColNames, int length, ObjectInspector rowInspector) throws HiveException
Operator.initEvaluatorsAndReturnStruct(ExprNodeEvaluator[], List, ObjectInspector)
HiveException
public void process(Object row, int tag) throws HiveException
Operator
process
in class Operator<ReduceSinkDesc>
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 final int computeMurmurHash(HiveKey firstKey)
protected HiveKey toHiveKey(Object obj, int tag, Integer distLength) throws SerDeException
SerDeException
public void collect(byte[] key, byte[] value, int hash) throws IOException
collect
in interface TopNHash.BinaryCollector
IOException
protected void collect(org.apache.hadoop.io.BytesWritable keyWritable, org.apache.hadoop.io.Writable valueWritable) throws IOException
IOException
protected void closeOp(boolean abort) throws HiveException
Operator
closeOp
in class Operator<ReduceSinkDesc>
HiveException
public String getName()
Operator
getName
in interface Node
getName
in class Operator<ReduceSinkDesc>
public static String getOperatorName()
public OperatorType getType()
Operator
getType
in class Operator<ReduceSinkDesc>
public boolean opAllowedBeforeMapJoin()
opAllowedBeforeMapJoin
in class Operator<ReduceSinkDesc>
public void setSkipTag(boolean value)
public void setValueIndex(int[] valueIndex)
public int[] getValueIndex()
public void setInputAliases(String[] inputAliases)
public String[] getInputAliases()
public void setOutputCollector(org.apache.hadoop.mapred.OutputCollector _out)
setOutputCollector
in class Operator<ReduceSinkDesc>
Copyright © 2017 The Apache Software Foundation. All rights reserved.