LogicalPlanVisitor — Contract for Computing Statistic Estimates and Query Hints of Logical Plan
LogicalPlanVisitor
is the contract that uses the visitor design pattern to scan a logical query plan and compute estimates of plan statistics and query hints.
Tip
|
Read about the visitor design pattern in Wikipedia. |
LogicalPlanVisitor
defines visit
method that dispatches computing the statistics of a logical plan to the corresponding handler methods.
1 2 3 4 5 |
visit(p: LogicalPlan): T |
Note
|
T stands for the type of a result to be computed (while visiting the query plan tree) and is currently always Statistics only.
|
The concrete LogicalPlanVisitor
is chosen per spark.sql.cbo.enabled configuration property. When turned on (i.e. true
), LogicalPlanStats
uses BasicStatsPlanVisitor while SizeInBytesOnlyStatsPlanVisitor otherwise.
Note
|
spark.sql.cbo.enabled configuration property is off, i.e. false by default.
|
LogicalPlanVisitor | Description |
---|---|
Logical Operator | Handler |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Other logical operators |
|