cloud-fan commented on a change in pull request #26775: [SPARK-30018][SQL]
Support ALTER DATABASE SET OWNER syntax
URL: https://github.com/apache/spark/pull/26775#discussion_r364629935
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
##########
@@ -388,20 +391,29 @@ class HiveCatalogedDDLSuite extends DDLSuite with
TestHiveSingleton with BeforeA
val db1 = "spark_29425_1"
val db2 = "spark_29425_2"
val owner = "spark_29425"
+ val currentUser = Utils.getCurrentUserName()
sql(s"CREATE DATABASE $db1")
- checkOwner(db1, Utils.getCurrentUserName())
+ checkOwner(db1, currentUser, "USER")
sql(s"ALTER DATABASE $db1 SET DBPROPERTIES ('a'='a')")
- checkOwner(db1, Utils.getCurrentUserName())
-
- // TODO: Specify ownership should be forbidden after we implement `SET
OWNER` syntax
- sql(s"CREATE DATABASE $db2 WITH DBPROPERTIES('ownerName'='$owner')")
- checkOwner(db2, owner)
- sql(s"ALTER DATABASE $db2 SET DBPROPERTIES ('a'='a')")
- checkOwner(db2, owner)
- // TODO: Changing ownership should be forbidden after we implement `SET
OWNER` syntax
- sql(s"ALTER DATABASE $db2 SET DBPROPERTIES ('ownerName'='a')")
- checkOwner(db2, "a")
+ checkOwner(db1, currentUser, "USER")
+ val e = intercept[AnalysisException](sql(s"ALTER DATABASE $db1 SET
DBPROPERTIES ('a'='a',"
+ + s"'ownerName'='$owner','ownerType'='XXX')"))
Review comment:
ok maybe it's fine to treat `Ownername` as a normal property.
----------------------------------------------------------------
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]