org.apache.hadoop.hive.ql.exec
Class CommonJoinOperator<T extends joinDesc>

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.Operator<T>
      extended by org.apache.hadoop.hive.ql.exec.CommonJoinOperator<T>
All Implemented Interfaces:
Serializable, Node
Direct Known Subclasses:
JoinOperator, MapJoinOperator

public abstract class CommonJoinOperator<T extends joinDesc>
extends Operator<T>
implements Serializable

Join operator implementation.

See Also:
Serialized Form

Nested Class Summary
static class CommonJoinOperator.IntermediateObject
           
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.exec.Operator
Operator.OperatorFunc, Operator.ProgressCounter, Operator.State
 
Field Summary
protected  Byte alias
           
protected  joinCond[] condn
           
protected  RowContainer<ArrayList<Object>>[] dummyObjVectors
           
protected  Map<Byte,List<ExprNodeEvaluator>> joinValues
          The expressions for join outputs.
protected  Map<Byte,List<ObjectInspector>> joinValuesObjectInspectors
          The ObjectInspectors for the join inputs.
protected  Map<Byte,List<ObjectInspector>> joinValuesStandardObjectInspectors
          The standard ObjectInspectors for the join inputs.
protected static org.apache.commons.logging.Log LOG
           
protected  boolean noOuterJoin
           
protected  int numAliases
           
protected static Byte[] order
           
protected  Map<Byte,tableDesc> spillTableDesc
           
protected  int totalSz
           
 
Fields inherited from class org.apache.hadoop.hive.ql.exec.Operator
beginTime, childOperators, childOperatorsArray, childOperatorsTag, colExprMap, conf, counterNames, counterNameToEnum, counters, done, fatalErrorCntr, id, inputObjInspectors, inputRows, numInputRowsCntr, numOutputRowsCntr, operatorId, out, outputObjInspector, outputRows, parentOperators, reporter, state, statsMap, timeTakenCntr, totalTime
 
Constructor Summary
CommonJoinOperator()
           
 
Method Summary
protected  void checkAndGenObject()
           
 void closeOp(boolean abort)
          All done
protected static ArrayList<Object> computeValues(Object row, List<ExprNodeEvaluator> valueFields, List<ObjectInspector> valueFieldsOI)
          Return the value as a standard object.
 void endGroup()
          Forward a record of join results.
protected static
<T extends joinDesc>
ObjectInspector
getJoinOutputObjectInspector(Byte[] order, Map<Byte,List<ObjectInspector>> aliasToObjectInspectors, T conf)
           
 String getName()
          Implements the getName function for the Node Interface.
protected  int getNextSize(int sz)
           
protected static HashMap<Byte,List<ObjectInspector>> getObjectInspectorsFromEvaluators(Map<Byte,List<ExprNodeEvaluator>> exprEntries, ObjectInspector[] inputObjInspector)
           
 Map<Integer,Set<String>> getPosToAliasMap()
           
 tableDesc getSpillTableDesc(Byte alias)
           
protected static HashMap<Byte,List<ObjectInspector>> getStandardObjectInspectors(Map<Byte,List<ObjectInspector>> aliasToObjectInspectors)
           
protected  void initializeOp(org.apache.hadoop.conf.Configuration hconf)
          Operator specific initialization.
protected  int populateJoinKeyValue(Map<Byte,List<ExprNodeEvaluator>> outMap, Map<Byte,List<exprNodeDesc>> inputMap)
           
 void setPosToAliasMap(Map<Integer,Set<String>> posToAliasMap)
           
 void startGroup()
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.Operator
areAllParentsInitialized, assignCounterNameToEnum, checkFatalErrors, close, dump, dump, fatalErrorMessage, forward, getChildOperators, getChildren, getColumnExprMap, getConf, getCounterNames, getCounterNameToEnum, getCounters, getDone, getIdentifier, getOperatorId, getParentOperators, getSchema, getStats, getType, incrCounter, initEvaluators, initEvaluatorsAndReturnStruct, initialize, initializeChildren, initializeCounters, initOperatorId, jobClose, logStats, preorderMap, process, processOp, removeChild, replaceChild, replaceParent, resetId, resetLastEnumUsed, resetStats, setAlias, setChildOperators, setColumnExprMap, setConf, setCounterNames, setCounterNameToEnum, setDone, setId, setOperatorId, setOutputCollector, setParentOperators, setReporter, setSchema, updateCounters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG

numAliases

protected transient int numAliases

joinValues

protected transient Map<Byte,List<ExprNodeEvaluator>> joinValues
The expressions for join outputs.


joinValuesObjectInspectors

protected transient Map<Byte,List<ObjectInspector>> joinValuesObjectInspectors
The ObjectInspectors for the join inputs.


joinValuesStandardObjectInspectors

protected transient Map<Byte,List<ObjectInspector>> joinValuesStandardObjectInspectors
The standard ObjectInspectors for the join inputs.


order

protected static transient Byte[] order

condn

protected transient joinCond[] condn

noOuterJoin

protected transient boolean noOuterJoin

dummyObjVectors

protected transient RowContainer<ArrayList<Object>>[] dummyObjVectors

totalSz

protected transient int totalSz

spillTableDesc

protected transient Map<Byte,tableDesc> spillTableDesc

alias

protected transient Byte alias
Constructor Detail

CommonJoinOperator

public CommonJoinOperator()
Method Detail

populateJoinKeyValue

protected int populateJoinKeyValue(Map<Byte,List<ExprNodeEvaluator>> outMap,
                                   Map<Byte,List<exprNodeDesc>> inputMap)

getObjectInspectorsFromEvaluators

protected static HashMap<Byte,List<ObjectInspector>> getObjectInspectorsFromEvaluators(Map<Byte,List<ExprNodeEvaluator>> exprEntries,
                                                                                       ObjectInspector[] inputObjInspector)
                                                                                throws HiveException
Throws:
HiveException

getStandardObjectInspectors

protected static HashMap<Byte,List<ObjectInspector>> getStandardObjectInspectors(Map<Byte,List<ObjectInspector>> aliasToObjectInspectors)

getJoinOutputObjectInspector

protected static <T extends joinDesc> ObjectInspector getJoinOutputObjectInspector(Byte[] order,
                                                                                   Map<Byte,List<ObjectInspector>> aliasToObjectInspectors,
                                                                                   T conf)

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<T extends joinDesc>
Throws:
HiveException

getSpillTableDesc

public tableDesc getSpillTableDesc(Byte alias)

startGroup

public void startGroup()
                throws HiveException
Overrides:
startGroup in class Operator<T extends joinDesc>
Throws:
HiveException

getNextSize

protected int getNextSize(int sz)

computeValues

protected static ArrayList<Object> computeValues(Object row,
                                                 List<ExprNodeEvaluator> valueFields,
                                                 List<ObjectInspector> valueFieldsOI)
                                          throws HiveException
Return the value as a standard object. StandardObject can be inspected by a standard ObjectInspector.

Throws:
HiveException

endGroup

public void endGroup()
              throws HiveException
Forward a record of join results.

Overrides:
endGroup in class Operator<T extends joinDesc>
Throws:
HiveException

checkAndGenObject

protected void checkAndGenObject()
                          throws HiveException
Throws:
HiveException

closeOp

public void closeOp(boolean abort)
             throws HiveException
All done

Overrides:
closeOp in class Operator<T extends joinDesc>
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<T extends joinDesc>
Returns:
the name of the operator

getPosToAliasMap

public Map<Integer,Set<String>> getPosToAliasMap()
Returns:
the posToAliasMap

setPosToAliasMap

public void setPosToAliasMap(Map<Integer,Set<String>> posToAliasMap)
Parameters:
posToAliasMap - the posToAliasMap to set


Copyright © 2009 The Apache Software Foundation