jzhuge commented on a change in pull request #24723: [SPARK-27857][SQL] Move
ALTER TABLE parsing into Catalyst
URL: https://github.com/apache/spark/pull/24723#discussion_r289158935
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/DDLParserSuite.scala
##########
@@ -394,4 +406,201 @@ class DDLParserSuite extends AnalysisTest {
parseCompare(s"DROP VIEW view", DropViewStatement(Seq("view"), ifExists =
false))
parseCompare(s"DROP VIEW IF EXISTS view", DropViewStatement(Seq("view"),
ifExists = true))
}
+
+ // ALTER VIEW view_name SET TBLPROPERTIES ('comment' = new_comment);
+ // ALTER VIEW view_name UNSET TBLPROPERTIES [IF EXISTS] ('comment', 'key');
+ test("alter view: alter view properties") {
+ val sql1_view = "ALTER VIEW table_name SET TBLPROPERTIES ('test' = 'test',
" +
+ "'comment' = 'new_comment')"
+ val sql2_view = "ALTER VIEW table_name UNSET TBLPROPERTIES ('comment',
'test')"
+ val sql3_view = "ALTER VIEW table_name UNSET TBLPROPERTIES IF EXISTS
('comment', 'test')"
+
+ val parsed1_view = parsePlan(sql1_view)
+ val parsed2_view = parsePlan(sql2_view)
+ val parsed3_view = parsePlan(sql3_view)
+
+ val expected1_view = AlterViewSetPropertiesStatement(
Review comment:
Is it possible to move the sql text and expected plan close to each other?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]