Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/14746#discussion_r76176938
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLViewSuite.scala
---
@@ -204,10 +206,67 @@ class SQLViewSuite extends QueryTest with
SQLTestUtils with TestHiveSingleton {
}
}
- test("should allow CREATE permanent VIEW when a TEMPORARY VIEW with same
name exists") {
+ test("ALTER VIEW: alter a temporary view when a permanent VIEW with same
name exists") {
+ verifyAlterViewWithIdenticalName(isTempAlteredView = true)
+ }
+
+ test("ALTER VIEW: alter a persistent view when a temp VIEW with same
name exists") {
+ verifyAlterViewWithIdenticalName(isTempAlteredView = false)
+ }
+
+ private def verifyAlterViewWithIdenticalName (isTempAlteredView:
Boolean) = {
+ withView("testView", "default.testView") {
+ val catalog = spark.sessionState.catalog
+ val oldViewQuery = "SELECT id FROM jt"
+ val newViewQuery = "SELECT id, id1 FROM jt"
--- End diff --
nit: remove extra spaces
---
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]