{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/11987","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/11987/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/11987/comments","events_url":"https://api.github.com/repos/apache/spark/issues/11987/events","html_url":"https://github.com/apache/spark/pull/11987","id":143786741,"number":11987,"title":"[SPARK-14182] [SQL] Parse DDL Command: Alter View","user":{"login":"gatorsmile","id":11567269,"avatar_url":"https://avatars.githubusercontent.com/u/11567269?v=3","gravatar_id":"","url":"https://api.github.com/users/gatorsmile","html_url":"https://github.com/gatorsmile","followers_url":"https://api.github.com/users/gatorsmile/followers","following_url":"https://api.github.com/users/gatorsmile/following{/other_user}","gists_url":"https://api.github.com/users/gatorsmile/gists{/gist_id}","starred_url":"https://api.github.com/users/gatorsmile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatorsmile/subscriptions","organizations_url":"https://api.github.com/users/gatorsmile/orgs","repos_url":"https://api.github.com/users/gatorsmile/repos","events_url":"https://api.github.com/users/gatorsmile/events{/privacy}","received_events_url":"https://api.github.com/users/gatorsmile/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-27T07:58:38Z","updated_at":"2016-03-29T03:21:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/11987","html_url":"https://github.com/apache/spark/pull/11987","diff_url":"https://github.com/apache/spark/pull/11987.diff","patch_url":"https://github.com/apache/spark/pull/11987.patch"},"body":"#### What changes were proposed in this pull request?\r\nThis PR is to provide native parsing support for DDL commands: `Alter View`. Since its AST trees are highly similar to `Alter Table`. Thus, both implementation are integrated into the same one.\r\n\r\nBased on the Hive DDL document:\r\nhttps://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL and https://cwiki.apache.org/confluence/display/Hive/PartitionedViews\r\n\r\n##### 1. ALTER VIEW RENAME\r\n**Syntax:**\r\n```SQL\r\nALTER VIEW view_name RENAME TO new_view_name\r\n```\r\n - to change the name of a view to a different name\r\n\r\n##### 2. ALTER VIEW SET TBLPROPERTIES\r\n**Syntax:**\r\n```SQL\r\nALTER VIEW view_name SET TBLPROPERTIES ('comment' = new_comment);\r\n```\r\n - to add metadata to a view\r\n\r\n##### 3. ALTER VIEW UNSET TBLPROPERTIES\r\n**Syntax:**\r\n```SQL\r\nALTER VIEW view_name UNSET TBLPROPERTIES [IF EXISTS] ('comment', 'key')\r\n```\r\n - to remove metadata from a view\r\n\r\n##### 4. ALTER VIEW ADD PARTITION\r\n**Syntax:**\r\n```SQL\r\nALTER VIEW view_name ADD [IF NOT EXISTS] PARTITION spec1[, PARTITION spec2, ...]\r\n```\r\n - to add the partitioning metadata for a view.\r\n - the syntax of partition spec in `ALTER VIEW` is identical to `ALTER TABLE`, **EXCEPT** that it is **ILLEGAL** to specify a `LOCATION` clause.\r\n\r\n##### 5. ALTER VIEW DROP PARTITION\r\n**Syntax:**\r\n```SQL\r\nALTER VIEW view_name DROP [IF EXISTS] PARTITION spec1[, PARTITION spec2, ...]\r\n```\r\n - to drop the related partition metadata for a view.\r\n\r\n#### How was this patch tested?\r\nAdded the related test cases to `DDLCommandSuite`"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/202687275","html_url":"https://github.com/apache/spark/pull/11987#issuecomment-202687275","issue_url":"https://api.github.com/repos/apache/spark/issues/11987","id":202687275,"user":{"login":"rxin","id":323388,"avatar_url":"https://avatars.githubusercontent.com/u/323388?v=3","gravatar_id":"","url":"https://api.github.com/users/rxin","html_url":"https://github.com/rxin","followers_url":"https://api.github.com/users/rxin/followers","following_url":"https://api.github.com/users/rxin/following{/other_user}","gists_url":"https://api.github.com/users/rxin/gists{/gist_id}","starred_url":"https://api.github.com/users/rxin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rxin/subscriptions","organizations_url":"https://api.github.com/users/rxin/orgs","repos_url":"https://api.github.com/users/rxin/repos","events_url":"https://api.github.com/users/rxin/events{/privacy}","received_events_url":"https://api.github.com/users/rxin/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T03:21:42Z","updated_at":"2016-03-29T03:21:42Z","body":"I just merged https://github.com/apache/spark/pull/12015\r\n\r\nCan you update to use the new ANTLR4 parser instead? We are going to remove the ANTLR3 one in the next day or two. Thanks."}}