Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11497#discussion_r55135039
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
    @@ -512,6 +512,9 @@ class Analyzer(
     
           // A special case for Generate, because the output of Generate 
should not be resolved by
           // ResolveReferences. Attributes in the output will be resolved by 
ResolveGenerate.
    +      case g @ Generate(generator, _, _, _, _, _)
    +        if !g.resolved && generator.resolved => g
    +
           case g @ Generate(generator, join, outer, qualifier, output, child)
    --- End diff --
    
    I think this 2 cases can be simplified to:
    ```
    case g: Generate if g.generator.resolved => g
    case g @ Generate(generator, join, outer, qualifier, output, child) =>
      the generator resolution logic...
    ```
    
    We only care about whether `generator` is resolved or not.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to