org.apache.hadoop.hive.ql.optimizer.correlation
Class QueryPlanTreeTransformation
java.lang.Object
org.apache.hadoop.hive.ql.optimizer.correlation.QueryPlanTreeTransformation
public class QueryPlanTreeTransformation
- extends Object
QueryPlanTreeTransformation contains static methods used to transform
the query plan tree (operator tree) based on the correlation we have
detected by Correlation Optimizer.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QueryPlanTreeTransformation
public QueryPlanTreeTransformation()
applyCorrelation
protected static void applyCorrelation(ParseContext pCtx,
CorrelationOptimizer.CorrelationNodeProcCtx corrCtx,
IntraQueryCorrelation correlation)
throws SemanticException
- Based on the correlation, we transform the query plan tree (operator tree).
In here, we first create DemuxOperator and all bottom ReduceSinkOperators
(bottom means near TableScanOperaotr) in the correlation will be be
the parents of the DemuxOperaotr. We also reassign tags to those
ReduceSinkOperators. Then, we use MuxOperators to replace ReduceSinkOperators
which are not bottom ones in this correlation.
Example: The original operator tree is ...
JOIN2
/ \
RS4 RS5
/ \
GBY1 JOIN1
| / \
RS1 RS2 RS3
If GBY1, JOIN1, and JOIN2 can be executed in the same reducer
(optimized by Correlation Optimizer).
The new operator tree will be ...
JOIN2
|
MUX
/ \
GBY1 JOIN1
\ /
DEMUX
/ | \
/ | \
/ | \
RS1 RS2 RS3
- Parameters:
pCtx
- corrCtx
- correlation
-
- Throws:
SemanticException
Copyright © 2012 The Apache Software Foundation