Skip to content

ReuseAdaptiveSubquery Physical Optimization

ReuseAdaptiveSubquery is a physical query plan optimization in Adaptive Query Execution.

ReuseAdaptiveSubquery is a Catalyst Rule for transforming physical plans (Rule[SparkPlan]).

Creating Instance

ReuseAdaptiveSubquery takes the following to be created:

ReuseAdaptiveSubquery is created when:

Executing Rule

apply(
  plan: SparkPlan): SparkPlan

apply is disabled (and returns the given SparkPlan) when the spark.sql.execution.reuseSubquery configuration property is false.

apply requests the given SparkPlan to transformAllExpressionsWithPruning with tree nodes with PLAN_EXPRESSION tree pattern:

apply is part of the Rule abstraction.