wangyum commented on code in PR #48789:
URL: https://github.com/apache/spark/pull/48789#discussion_r1835547499
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala:
##########
@@ -773,7 +773,15 @@ case class AdaptiveSparkPlanExec(
case _ => newPlan
}
- Some((finalPlan, optimized))
+ if (!RemoveRedundantProjects.isOutputMatched(inputPlan.output,
finalPlan.output)) {
+ val wrapProjectPlan = finalPlan match {
+ case e: Exchange => e.withNewChildren(ProjectExec(inputPlan.output,
e.child) :: Nil)
Review Comment:
Add project to child if it is Exchange to avoid assertion failed:
```
Caused by: java.lang.AssertionError: assertion failed
at scala.Predef$.assert(Predef.scala:208)
at
org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanExec.$anonfun$doExecuteBroadcast$1(AdaptiveSparkPlanExec.scala:425)
at
org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanExec.withFinalPlanUpdate(AdaptiveSparkPlanExec.scala:432)
at
org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanExec.doExecuteBroadcast(AdaptiveSparkPlanExec.scala:424)
at
org.apache.spark.sql.execution.SparkPlan.$anonfun$executeBroadcast$1(SparkPlan.scala:209)
at
org.apache.spark.sql.execution.SparkPlan.$anonfun$executeQuery$1(SparkPlan.scala:247)
at
org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
at
org.apache.spark.sql.execution.SparkPlan.executeQuery(SparkPlan.scala:244)
at
org.apache.spark.sql.execution.SparkPlan.executeBroadcast(SparkPlan.scala:205)
```
--
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]