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

    https://github.com/apache/spark/pull/21305#discussion_r200428354
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
    @@ -172,6 +173,7 @@ class Analyzer(
           ResolveWindowOrder ::
           ResolveWindowFrame ::
           ResolveNaturalAndUsingJoin ::
    +      ResolveOutputRelation ::
    --- End diff --
    
    This rule may add `Projection`, `UpCast`, and `Alias` nodes to the plan, so 
there are some rules in this batch that should be run after the output is 
resolved. `ResolveUpCast` will rewrite the casts that were inserted and throw 
exceptions if the cast would truncate and needs to run after this rule.
    
    I could also create a batch just after resolution for output resolution. We 
could just run this rule and `ResolveUpCast`. I think the optimizer will handle 
collapsing `Projection` nodes and aliases are only resolved in this batch, so 
adding resolved aliases shouldn't be a problem. Would you like a separate batch 
for output resolution?


---

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

Reply via email to