Github user mgaido91 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22957#discussion_r238459238
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala
 ---
    @@ -145,9 +145,14 @@ case class EnsureRequirements(conf: SQLConf) extends 
Rule[SparkPlan] {
         assert(requiredChildDistributions.length == children.length)
         assert(requiredChildOrderings.length == children.length)
     
    +    val aliasMap = 
AttributeMap[Expression](children.flatMap(_.expressions.collect {
    --- End diff --
    
    I think it is. We are only checking the presence of aliases. In particular, 
we are collecting all the aliases which are defined in the previous operator. 
The solution you are suggesting works too IMHO and restricts the scope, but I 
am not sure it is a good thing, because I see no harm in doing it for other 
operators: simply they won't contain aliases; while I do see some issues in the 
maintenance of the "whitelist" of operators you are suggesting (we may miss 
some now or forget to update later...)


---

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

Reply via email to