bowenliang123 commented on code in PR #5493:
URL: https://github.com/apache/kyuubi/pull/5493#discussion_r1367725616
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RangerSparkExtensionSuite.scala:
##########
@@ -835,4 +835,19 @@ class HiveCatalogRangerSparkExtensionSuite extends
RangerSparkExtensionSuite {
assert(e2.getMessage.contains(s"does not have [select] privilege on
[$db1/$view1/new_id]"))
}
}
+
+ test("[KYUUBI #5492] saveAsTable create DataSource table miss db info") {
+ val table1 = "table1"
+ withSingleCallEnabled {
+ withCleanTmpResources(Seq.empty) {
+ val df = doAs(
+ admin,
+ sql(s"SELECT * FROM VALUES(1, 100),(2, 200),(3, 300) AS t(id,
scope)")).persist()
+ val e = intercept[AccessControlException] {
+ doAs(someone, df.write.mode("overwrite").saveAsTable(table1))
+ }
+ assert(e.getMessage.contains(s"does not have [create] privilege on
[$defaultDb/$table1]"))
Review Comment:
Hi, you may use the `interceptContains` method to simplify the assertions.
Very handy and clear.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]