Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Public Member Functions | |
PlanFragment (PlanFragmentId id, PlanNode root, DataPartition partition) | |
void | setOutputExprs (List< Expr > outputExprs) |
List< Expr > | getOutputExprs () |
void | finalize (Analyzer analyzer) throws InternalException, NotImplementedException |
int | getNumNodes () |
long | getNumDistinctValues (List< Expr > exprs) |
TPlanFragment | toThrift () |
String | getExplainString (TExplainLevel explainLevel) |
boolean | isPartitioned () |
PlanFragmentId | getId () |
PlanFragment | getDestFragment () |
ExchangeNode | getDestNode () |
DataPartition | getDataPartition () |
void | setDataPartition (DataPartition dataPartition) |
DataPartition | getOutputPartition () |
void | setOutputPartition (DataPartition outputPartition) |
PlanNode | getPlanRoot () |
void | setPlanRoot (PlanNode root) |
void | setDestination (ExchangeNode destNode) |
boolean | hasSink () |
DataSink | getSink () |
void | setSink (DataSink sink) |
void | addPlanRoot (PlanNode newRoot) |
Private Member Functions | |
void | setFragmentInPlanTree (PlanNode node) |
boolean | computeCanAddSlotFilters (PlanNode node) |
Private Attributes | |
final PlanFragmentId | fragmentId_ |
PlanNode | planRoot_ |
ExchangeNode | destNode_ |
List< Expr > | outputExprs_ |
DataSink | sink_ |
DataPartition | dataPartition_ |
DataPartition | outputPartition_ |
Static Private Attributes | |
static final Logger | LOG = LoggerFactory.getLogger(PlanFragment.class) |
A PlanFragment is part of a tree of such fragments that together make up a complete execution plan for a single query. Each plan fragment can have one or many instances, each of which in turn is executed by a single node and the output sent to a specific instance of the destination fragment (or, in the case of the root fragment, is materialized in some form).
The plan fragment encapsulates the specific tree of execution nodes that are used to produce the output of the plan fragment, as well as output exprs, destination node, etc. If there are no output exprs, the full row that is is produced by the plan root is marked as materialized.
A hash-partitioned plan fragment is the result of one or more hash-partitioning data streams being received by plan nodes in this fragment. In the future, a fragment's data partition could also be hash partitioned based on a scan node that is reading from a physically hash-partitioned table.
The sequence of calls is:
Definition at line 63 of file PlanFragment.java.
|
inline |
C'tor for fragment with specific partition; the output is by default broadcast.
Definition at line 93 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.dataPartition_, com.cloudera.impala.planner.PlanFragment.fragmentId_, com.cloudera.impala.planner.PlanFragment.outputPartition_, com.cloudera.impala.planner.PlanFragment.planRoot_, com.cloudera.impala.planner.PlanFragment.setFragmentInPlanTree(), and com.cloudera.impala.planner.DataPartition.UNPARTITIONED.
|
inline |
Adds a node as the new root to the plan tree. Connects the existing root as the child of newRoot.
Definition at line 355 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.planRoot_.
|
inlineprivate |
Returns true and sets node.canAddPredicate, if we can add single-slot filters at execution time (i.e. after Prepare() to the plan tree rooted at this node. That is, 'node' can add filters that can be evaluated at nodes below.
We compute this by walking the tree bottom up.
TODO: move this to PlanNode.init() which is normally responsible for computing internal state of PlanNodes. We cannot do this currently since we need the distrubutionMode() set on HashJoin nodes. Once we call init() properly for repartitioned joins, this logic can move to init().
Definition at line 195 of file PlanFragment.java.
References com.cloudera.impala.planner.ScanNode.desc_, com.cloudera.impala.analysis.JoinOperator.FULL_OUTER_JOIN, com.cloudera.impala.planner.HashJoinNode.getDistributionMode(), com.cloudera.impala.planner.HashJoinNode.getJoinOp(), com.cloudera.impala.catalog.HdfsTable.getMajorityFormat(), com.cloudera.impala.analysis.TupleDescriptor.getTable(), com.cloudera.impala.analysis.JoinOperator.LEFT_ANTI_JOIN, com.cloudera.impala.analysis.JoinOperator.LEFT_OUTER_JOIN, com.cloudera.impala.analysis.JoinOperator.NULL_AWARE_LEFT_ANTI_JOIN, com.cloudera.impala.catalog.HdfsFileFormat.PARQUET, and com.cloudera.impala.planner.HashJoinNode.DistributionMode.PARTITIONED.
Referenced by com.cloudera.impala.planner.PlanFragment.finalize().
|
inline |
Finalize plan tree and create stream sink, if needed. If this fragment is hash partitioned, ensures that the corresponding partition exprs of all hash-partitioning senders are cast to identical types. Otherwise, the hashes generated for identical partition values may differ among senders if the partition-expr types are not identical.
Definition at line 128 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.computeCanAddSlotFilters(), com.cloudera.impala.planner.PlanFragment.dataPartition_, com.cloudera.impala.planner.PlanFragment.destNode_, com.cloudera.impala.planner.DataPartition.getPartitionExprs(), com.cloudera.impala.planner.DataPartition.isHashPartitioned(), com.cloudera.impala.planner.PlanFragment.outputPartition_, com.cloudera.impala.planner.PlanFragment.planRoot_, and com.cloudera.impala.planner.PlanFragment.sink_.
|
inline |
Definition at line 327 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.dataPartition_.
|
inline |
Definition at line 322 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.destNode_.
|
inline |
Definition at line 326 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.destNode_.
|
inline |
|
inline |
Definition at line 321 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.fragmentId_.
|
inline |
Estimates the per-node number of distinct values of exprs based on the data partition of this fragment and its number of nodes. Returns -1 for an invalid estimate, e.g., because getNumDistinctValues() failed on one of the exprs.
Definition at line 254 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.dataPartition_, com.cloudera.impala.planner.PlanFragment.getNumNodes(), and com.cloudera.impala.planner.DataPartition.getPartitionExprs().
|
inline |
Return the number of nodes on which the plan fragment will execute. invalid: -1
Definition at line 179 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.dataPartition_.
Referenced by com.cloudera.impala.planner.PlanFragment.getNumDistinctValues().
|
inline |
Definition at line 119 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.outputExprs_.
|
inline |
Definition at line 331 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.outputPartition_.
|
inline |
Definition at line 335 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.planRoot_.
|
inline |
Definition at line 343 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.sink_.
|
inline |
Definition at line 342 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.sink_.
|
inline |
Returns true if this fragment is partitioned.
Definition at line 317 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.dataPartition_, and com.cloudera.impala.planner.DataPartition.getType().
Referenced by com.cloudera.impala.planner.DistributedPlanner.createPlanFragments(), com.cloudera.impala.planner.DistributedPlanner.createUnionNodeFragment(), com.cloudera.impala.planner.ExchangeNode.getDisplayLabelDetail(), and com.cloudera.impala.planner.HdfsScanNode.getNodeExplainString().
|
inline |
Definition at line 328 of file PlanFragment.java.
|
inline |
Definition at line 341 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.destNode_.
|
inlineprivate |
Assigns 'this' as fragment of all PlanNodes in the plan tree rooted at node. Does not traverse the children of ExchangeNodes because those must belong to a different fragment.
Definition at line 106 of file PlanFragment.java.
Referenced by com.cloudera.impala.planner.PlanFragment.PlanFragment(), and com.cloudera.impala.planner.PlanFragment.setPlanRoot().
|
inline |
Definition at line 116 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.outputExprs_.
|
inline |
Definition at line 332 of file PlanFragment.java.
|
inline |
Definition at line 336 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.planRoot_, and com.cloudera.impala.planner.PlanFragment.setFragmentInPlanTree().
|
inline |
Definition at line 344 of file PlanFragment.java.
|
inline |
Definition at line 275 of file PlanFragment.java.
References com.cloudera.impala.planner.PlanFragment.outputExprs_, com.cloudera.impala.planner.PlanFragment.planRoot_, and com.cloudera.impala.planner.PlanFragment.sink_.
|
private |
Definition at line 83 of file PlanFragment.java.
Referenced by com.cloudera.impala.planner.PlanFragment.finalize(), com.cloudera.impala.planner.PlanFragment.getDataPartition(), com.cloudera.impala.planner.PlanFragment.getExplainString(), com.cloudera.impala.planner.PlanFragment.getNumDistinctValues(), com.cloudera.impala.planner.PlanFragment.getNumNodes(), com.cloudera.impala.planner.PlanFragment.isPartitioned(), and com.cloudera.impala.planner.PlanFragment.PlanFragment().
|
private |
|
private |
Definition at line 66 of file PlanFragment.java.
Referenced by com.cloudera.impala.planner.PlanFragment.getId(), and com.cloudera.impala.planner.PlanFragment.PlanFragment().
|
staticprivate |
Definition at line 64 of file PlanFragment.java.
|
private |
Definition at line 75 of file PlanFragment.java.
Referenced by com.cloudera.impala.planner.PlanFragment.getOutputExprs(), com.cloudera.impala.planner.PlanFragment.setOutputExprs(), and com.cloudera.impala.planner.PlanFragment.toThrift().
|
private |
Definition at line 88 of file PlanFragment.java.
Referenced by com.cloudera.impala.planner.PlanFragment.finalize(), com.cloudera.impala.planner.PlanFragment.getOutputPartition(), and com.cloudera.impala.planner.PlanFragment.PlanFragment().
|
private |
Definition at line 69 of file PlanFragment.java.
Referenced by com.cloudera.impala.planner.PlanFragment.addPlanRoot(), com.cloudera.impala.planner.PlanFragment.finalize(), com.cloudera.impala.planner.PlanFragment.getExplainString(), com.cloudera.impala.planner.PlanFragment.getPlanRoot(), com.cloudera.impala.planner.PlanFragment.PlanFragment(), com.cloudera.impala.planner.PlanFragment.setPlanRoot(), and com.cloudera.impala.planner.PlanFragment.toThrift().
|
private |
Definition at line 78 of file PlanFragment.java.
Referenced by com.cloudera.impala.planner.PlanFragment.finalize(), com.cloudera.impala.planner.PlanFragment.getExplainString(), com.cloudera.impala.planner.PlanFragment.getSink(), com.cloudera.impala.planner.PlanFragment.hasSink(), and com.cloudera.impala.planner.PlanFragment.toThrift().