org.apache.hadoop.hive.ql.exec
Class LateralViewJoinOperator
java.lang.Object
org.apache.hadoop.hive.ql.exec.Operator<LateralViewJoinDesc>
org.apache.hadoop.hive.ql.exec.LateralViewJoinOperator
- All Implemented Interfaces:
- Serializable, Cloneable, 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
Method Summary |
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. |
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 |
acceptLimitPushdown, augmentPlan, cleanUpInputFileChanged, cleanUpInputFileChangedOp, clone, cloneOp, cloneRecursiveChildren, close, columnNamesRowResolvedCanBeObtained, dump, dump, endGroup, flush, 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, startGroup, supportAutomaticSortMergeJoin, supportSkewJoinOptimization, supportUnionRemoveOptimization, toString, toString |
SELECT_TAG
public static final byte SELECT_TAG
- See Also:
- Constant Field Values
UDTF_TAG
public static final byte UDTF_TAG
- See Also:
- Constant Field Values
LateralViewJoinOperator
public LateralViewJoinOperator()
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
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<LateralViewJoinDesc>
- Returns:
- OperatorType.*
Copyright © 2014 The Apache Software Foundation. All rights reserved.