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

    https://github.com/apache/spark/pull/21822#discussion_r204190535
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
    @@ -231,10 +231,11 @@ class Analyzer(
        * Substitute child plan with WindowSpecDefinitions.
        */
       object WindowsSubstitution extends Rule[LogicalPlan] {
    -    def apply(plan: LogicalPlan): LogicalPlan = plan.transformUp {
    +    def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperators {
           // Lookup WindowSpecDefinitions. This rule works with unresolved 
children.
           case WithWindowDefinition(windowDefinitions, child) =>
    -        child.transform {
    +        // TODO(rxin): Check with Herman whether the next line is OK.
    --- End diff --
    
    It is good. The earlier `resolveOperators` makes sure we don't overwrite a 
window spec, with a similarly named one defined higher up the tree. BTW I don't 
think we have a test that covers this (it is pretty rare).


---

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

Reply via email to