cloud-fan commented on a change in pull request #32816:
URL: https://github.com/apache/spark/pull/32816#discussion_r691845304
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala
##########
@@ -169,10 +164,33 @@ case class AdaptiveSparkPlanExec(
optimized
}
+ private def checkDistribution(
+ newPlan: SparkPlan,
+ originPlan: SparkPlan,
+ isFinalStage: Boolean,
+ ruleName: String): SparkPlan = {
+ val distribution = if (isFinalStage) {
+ // If `requiredDistribution` is None, it means `EnsureRequirements` will
not optimize
+ // out the user-specified repartition, thus we don't have a distribution
requirement
+ // for the final plan.
+ requiredDistribution.getOrElse(UnspecifiedDistribution)
+ } else {
+ UnspecifiedDistribution
+ }
+ if (ValidateRequirements.validate(newPlan, distribution)) {
+ newPlan
+ } else {
+ logDebug(s"Rule $ruleName is not applied as it breaks the " +
+ "distribution requirement of the query plan.")
+ originPlan
+ }
+ }
+
@transient private val costEvaluator =
conf.getConf(SQLConf.ADAPTIVE_CUSTOM_COST_EVALUATOR_CLASS) match {
case Some(className) => CostEvaluator.instantiate(className,
session.sparkContext.getConf)
- case _ => SimpleCostEvaluator
+ case _ =>
+
SkewJoinAwareCostEvaluator(conf.getConf(SQLConf.ADAPTIVE_FORCE_OPTIMIZE_SKEWED_JOIN))
Review comment:
We can still call it `SimpleCostEvaluator`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]