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

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.Operator<LateralViewJoinDesc>
      extended by org.apache.hadoop.hive.ql.exec.LateralViewJoinOperator
All Implemented Interfaces:
Serializable, Node

public class LateralViewJoinOperator
extends Operator<LateralViewJoinDesc>

The lateral view join operator is used for FROM src LATERAL VIEW udtf()... This operator was implemented with the following operator DAG in mind. For a query such as SELECT pageid, adid.* FROM example_table LATERAL VIEW explode(adid_list) AS adid The top of the operator DAG will look similar to [Table Scan] | [Lateral View Forward] / \ [Select](*) [Select](adid_list) | | | [UDTF] (explode) \ / [Lateral View Join] | | [Select] (pageid, adid.*) | .... Rows from the table scan operator are first to a lateral view forward operator that just forwards the row and marks the start of a LV. The select operator on the left picks all the columns while the select operator on the right picks only the columns needed by the UDTF. The output of select in the left branch and output of the UDTF in the right branch are then sent to the lateral view join (LVJ). In most cases, the UDTF will generate > 1 row for every row received from the TS, while the left select operator will generate only one. For each row output from the TS, the LVJ outputs all possible rows that can be created by joining the row from the left select and one of the rows output from the UDTF. Additional lateral views can be supported by adding a similar DAG after the previous LVJ operator.

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
 
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, LOG, numInputRowsCntr, numOutputRowsCntr, operatorId, out, outputObjInspector, outputRows, parentOperators, reporter, state, statsMap, timeTakenCntr, totalTime
 
Constructor Summary
LateralViewJoinOperator()
           
 
Method Summary
 String getName()
          Implements the getName function for the Node Interface.
 int getType()
          Should be overridden to return the type of the specific operator among the types in OperatorType.
protected  void initializeOp(org.apache.hadoop.conf.Configuration hconf)
          Operator specific initialization.
 void processOp(Object row, int tag)
          An important assumption for processOp() is that for a given row from the TS, the LVJ will first get the row from the left select operator, followed by all the corresponding rows from the UDTF operator.
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.Operator
allInitializedParentsAreClosed, areAllParentsInitialized, assignCounterNameToEnum, augmentPlan, checkFatalErrors, close, closeOp, dump, dump, endGroup, fatalErrorMessage, forward, getChildOperators, getChildren, getColumnExprMap, getConf, getCounterNames, getCounterNameToEnum, getCounters, getDone, getExecContext, getGroupKeyObject, getIdentifier, getOperatorId, getParentOperators, getSchema, getStats, incrCounter, initEvaluators, initEvaluatorsAndReturnStruct, initialize, initializeChildren, initializeCounters, initializeLocalWork, initOperatorId, jobClose, logStats, passExecContext, preorderMap, process, removeChild, replaceChild, replaceParent, resetId, resetLastEnumUsed, resetStats, setAlias, setChildOperators, setColumnExprMap, setConf, setCounterNames, setCounterNameToEnum, setDone, setExecContext, setGroupKeyObject, setId, setOperatorId, setOutputCollector, setParentOperators, setReporter, setSchema, startGroup, updateCounters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LateralViewJoinOperator

public LateralViewJoinOperator()
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<LateralViewJoinDesc>
Throws:
HiveException

processOp

public void processOp(Object row,
                      int tag)
               throws HiveException
An important assumption for processOp() is that for a given row from the TS, the LVJ will first get the row from the left select operator, followed by all the corresponding rows from the UDTF operator. And so on.

Specified by:
processOp in class Operator<LateralViewJoinDesc>
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<LateralViewJoinDesc>
Returns:
the name of the operator

getType

public int getType()
Description copied from class: Operator
Should be overridden to return the type of the specific operator among the types in OperatorType.

Overrides:
getType in class Operator<LateralViewJoinDesc>
Returns:
OperatorType.* or -1 if not overridden


Copyright © 2010 The Apache Software Foundation