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

    https://github.com/apache/spark/pull/17400#discussion_r209909106
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala
 ---
    @@ -321,6 +321,58 @@ case class EnsureRequirements(conf: SQLConf) extends 
Rule[SparkPlan] {
         }
       }
     
    +  private def updatePartitioningByAliases(exprs: Seq[NamedExpression], 
partioning: Partitioning)
    +    : Partitioning = {
    +    val aliasSeq = exprs.flatMap(_.collectFirst {
    --- End diff --
    
    this might do more than you'd like it to (at least if it behaves the way I 
understand collect first), i.e.
    `df.select($"x" as "x1, struct($"a" as "a1", $"b" as "b1") as "s1")`
    
    _x1_ and _s1_ are aliases, _a1_ and _b1_ are not. it could even get more 
complicated if there was an _a1_ alias in the top level projections list.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to