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

    https://github.com/apache/spark/pull/11987#discussion_r57946641
  
    --- Diff: 
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/ng/SqlBase.g4 
---
    @@ -102,6 +102,15 @@ statement
             (PARTITIONED ON identifierList)?
             (TBLPROPERTIES tablePropertyList)? AS query                    
#createView
         | ALTER VIEW tableIdentifier AS? query                             
#alterViewQuery
    +    | ALTER VIEW from=tableIdentifier AS? RENAME TO to=tableIdentifier 
#renameView
    --- End diff --
    
    I don't think we need a dedicated label (i.e. `#renameView`) for this, we 
can just re-use `#renameTable` for this. That way you don't have to add any 
code to `SparkSqlParser`. The same goes for all these commands.
    
    We can also integrate this with the `ALTER TABLE ...` equivalent rules 
(i.e. `ALTER (TABLE|VIEW) ...`. But this is a bit messier, and I'll leave that 
to you.


---
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