Spark 之 SparkSessionExtensions
SparkSessionExtensions
org.apache.spark.sql.internal.BaseSessionStateBuilder
/**
* Session extensions defined in the [[SparkSession]].
*/
protected def extensions: SparkSessionExtensions = session.extensions
/**
* Custom strategies to add to the planner. Prefer overriding this instead of creating
* your own Planner.
*
* Note that this may NOT depend on the `planner` function.
*/
protected def customPlanningStrategies: Seq[Strategy] = {
extensions.buildPlannerStrategies(session)
}
protected def columnarRules: Seq[ColumnarRule] = {
extensions.buildColumnarRules(session)
}
protected def adaptiveRulesHolder: AdaptiveRulesHolder = {
new AdaptiveRulesHolder(
extensions.buildQueryStagePrepRules(session),
extensions.buildRuntimeOptimizerRules(session),
extensions.buildQueryStageOptimizerRules(session),
extensions.buildQueryPostPlannerStrategyRules(session))
}
protected def planNormalizationRules: Seq[Rule[LogicalPlan]] = {
extensions.buildPlanNormalizationRules(session)
}
extensions 使用的地方
org.apache.spark.sql.execution.QueryExecution.scala
ApplyColumnarRulesAndInsertTransitions(
sparkSession.sessionState.columnarRules, outputsColumnar = false),
原文地址:https://blog.csdn.net/zhixingheyi_tian/article/details/143914824
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!