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

SparkSessionExtensions

SparkSessionExtensions

SparkSessionExtensions is an interface that a Spark developer can use to extend a SparkSession with custom query execution rules and a relational entity parser.

As a Spark developer, you use Builder.withExtensions method (while building a new SparkSession) to access the session-bound SparkSessionExtensions.

Table 1. SparkSessionExtensions API
Method Description

injectCheckRule

injectOptimizerRule

Registering a custom operator optimization rule

injectParser

injectPlannerStrategy

injectPostHocResolutionRule

injectResolutionRule

SparkSessionExtensions is an integral part of SparkSession (and is indirectly required to create one).

Table 2. SparkSessionExtensions’s Internal Properties (e.g. Registries, Counters and Flags)
Name Description

optimizerRules

Collection of RuleBuilder functions (i.e. SparkSession ⇒ Rule[LogicalPlan])

Used when SparkSessionExtensions is requested to:

Associating Custom Operator Optimization Rules with SparkSession — buildOptimizerRules Method

buildOptimizerRules gives the optimizerRules logical rules that are associated with the input SparkSession.

Note
buildOptimizerRules is used exclusively when BaseSessionStateBuilder is requested for the custom operator optimization rules to add to the base Operator Optimization batch.

Registering Custom Check Analysis Rule (Builder) — injectCheckRule Method

injectCheckRule…​FIXME

Registering Custom Operator Optimization Rule (Builder) — injectOptimizerRule Method

injectOptimizerRule simply registers a custom operator optimization rule (as a RuleBuilder function) to the optimizerRules internal registry.

Registering Custom Parser (Builder) — injectParser Method

injectParser…​FIXME

Registering Custom Planner Strategy (Builder) — injectPlannerStrategy Method

injectPlannerStrategy…​FIXME

Registering Custom Post-Hoc Resolution Rule (Builder) — injectPostHocResolutionRule Method

injectPostHocResolutionRule…​FIXME

Registering Custom Resolution Rule (Builder) — injectResolutionRule Method

injectResolutionRule…​FIXME

赞(0) 打赏
未经允许不得转载:spark技术分享 » SparkSessionExtensions
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏