Github user peter-toth commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22518#discussion_r219617722
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/subquery.scala ---
    @@ -166,7 +168,7 @@ case class ReuseSubquery(conf: SQLConf) extends 
Rule[SparkPlan] {
             val sameSchema = subqueries.getOrElseUpdate(sub.plan.schema, 
ArrayBuffer[SubqueryExec]())
             val sameResult = sameSchema.find(_.sameResult(sub.plan))
             if (sameResult.isDefined) {
    -          sub.withNewPlan(sameResult.get)
    +          sub.withNewPlan(sameResult.get).withNewExprId()
    --- End diff --
    
    Can we avoid double copy()? Or is it cleaner this way?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to