-
Notifications
You must be signed in to change notification settings - Fork 75
[NSE-947] Add a whole stage fallback strategy #948
Conversation
15c04f6
to
e75e7d4
Compare
This reverts commit c4210ccfe39fac9b144117ec403bd9b00d8b5703.
…urce BatchScanExec
e75e7d4
to
0da5459
Compare
} | ||
isLeafPlanExchange || (SQLConf.get.adaptiveExecutionEnabled && (sanityCheck(plan) && | ||
!plan.logicalLink.exists(_.isStreaming) && | ||
!plan.expressions.exists(_.find(_.isInstanceOf[DynamicPruningSubquery]).isDefined) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part of code is ported from spark's source code. From spark 3.2, DPP can be coexisted with AQE, so the below statement should be removed for spark 3.2. We differentiated the implementation in shim layers.
!plan.expressions.exists(_.find(_.isInstanceOf[DynamicPruningSubquery]).isDefined
def supportAdaptive(plan: SparkPlan): Boolean | ||
|
||
def supportAdaptiveWithExchangeConsidered(plan: SparkPlan): Boolean = { | ||
isLeafPlanExchange(plan) || supportAdaptive(plan) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks isLeafPlanExchange should not be checked recursively. So we moved it from #supportAdaptive.
Such handling can fix issues for tpc-ds q23b in spark 3.1, where the code wrongly judges that AQE is supported.
/** | ||
* Ported from InsertAdaptiveSparkPlan. | ||
*/ | ||
override def supportAdaptive(plan: SparkPlan): Boolean = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistent with spark 3.1 source code.
/** | ||
* Ported from InsertAdaptiveSparkPlan. | ||
*/ | ||
override def supportAdaptive(plan: SparkPlan): Boolean = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistent with spark 3.2 source code.
2e9998a
to
9de4841
Compare
What changes were proposed in this pull request?
Let whole stage fallback if there would be 3 or more fallbacks in a stage.
How was this patch tested?
UT.