Github user markhamstra commented on a diff in the pull request: https://github.com/apache/spark/pull/21754#discussion_r203416454 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/Exchange.scala --- @@ -85,14 +85,20 @@ case class ReusedExchangeExec(override val output: Seq[Attribute], child: Exchan */ case class ReuseExchange(conf: SQLConf) extends Rule[SparkPlan] { + private def supportReuseExchange(exchange: Exchange): Boolean = exchange match { + // If a coordinator defined in an exchange operator, the exchange cannot be reused --- End diff -- This seems overstated if this comment in the JIRA description is correct: "When the cache tabel device_loc is executed before this query is executed, everything is fine". In fact, if Xiao Li is correct in that statement, then this PR is eliminating a useful optimization in cases where it doesn't need to -- i.e. it is preventing Exchange reuse any time adaptive execution is used instead of only preventing reuse when it will actually cause a problem.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org