关注 spark技术分享,
撸spark源码 玩spark最佳实践

BasicStatsPlanVisitor — Computing Statistics for Cost-Based Optimization

BasicStatsPlanVisitor — Computing Statistics for Cost-Based Optimization

BasicStatsPlanVisitor is a LogicalPlanVisitor that computes the statistics of a logical query plan for cost-based optimization (i.e. when cost-based optimization is enabled).

Note
Cost-based optimization is enabled when spark.sql.cbo.enabled configuration property is on, i.e. true, and is disabled by default.

BasicStatsPlanVisitor is used exclusively when a logical operator is requested for the statistics with cost-based optimization enabled.

BasicStatsPlanVisitor comes with custom handlers for a few logical operators and falls back to SizeInBytesOnlyStatsPlanVisitor for the others.

Table 1. BasicStatsPlanVisitor’s Visitor Handlers
Logical Operator Handler Behaviour

Aggregate

visitAggregate

Requests AggregateEstimation for statistics estimates and query hints or falls back to SizeInBytesOnlyStatsPlanVisitor

Filter

visitFilter

Requests FilterEstimation for statistics estimates and query hints or falls back to SizeInBytesOnlyStatsPlanVisitor

Join

visitJoin

Requests JoinEstimation for statistics estimates and query hints or falls back to SizeInBytesOnlyStatsPlanVisitor

Project

visitProject

Requests ProjectEstimation for statistics estimates and query hints or falls back to SizeInBytesOnlyStatsPlanVisitor

赞(0) 打赏
未经允许不得转载:spark技术分享 » BasicStatsPlanVisitor — Computing Statistics for Cost-Based Optimization
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏