You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/15 02:22:52 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #33188: [SPARK-35989][SQL] Only remove redundant shuffle if shuffle origin is REPARTITION_BY_COL in AQE
cloud-fan commented on a change in pull request #33188:
URL: https://github.com/apache/spark/pull/33188#discussion_r670076563
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala
##########
@@ -250,7 +250,12 @@ object EnsureRequirements extends Rule[SparkPlan] {
def apply(plan: SparkPlan): SparkPlan = plan.transformUp {
// TODO: remove this after we create a physical operator for `RepartitionByExpression`.
- case operator @ ShuffleExchangeExec(upper: HashPartitioning, child, _) =>
+ // SPARK-35989: AQE will change the partition number so we should retain the REPARTITION_BY_NUM
+ // shuffle which is specified by user. And also we can not remove REBALANCE_PARTITIONS_BY_COL,
+ // it is a special shuffle used to rebalance partitions.
+ // So, here we only remove REPARTITION_BY_COL in AQE.
+ case operator @ ShuffleExchangeExec(upper: HashPartitioning, child, shuffleOrigin)
+ if shuffleOrigin == REPARTITION_BY_COL || !conf.adaptiveExecutionEnabled =>
Review comment:
This may introduce perf regression but can simplify AQE code a lot. What do you think? @maryannxue @JkSelf
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org