AngersZhuuuu commented on code in PR #5693:
URL: https://github.com/apache/kyuubi/pull/5693#discussion_r1393734565
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RangerSparkExtensionSuite.scala:
##########
@@ -1340,4 +1340,25 @@ class HiveCatalogRangerSparkExtensionSuite extends
RangerSparkExtensionSuite {
}
}
}
+
+ test("[KYUUBI #5692][Bug] Authz not skip explain command") {
+ val db1 = defaultDb
+ val table1 = "table1"
+ withSingleCallEnabled {
+ withCleanTmpResources(Seq((s"$db1.$table1", "table"))) {
+ doAs(admin, sql(s"CREATE TABLE IF NOT EXISTS $db1.$table1 (id int,
scope int)"))
+ val explainSql =
+ s"""
+ |EXPLAIN
+ |SELECT id FROM $db1.$table1
+ |""".stripMargin
+ doAs(admin, sql(explainSql))
+ doAs(someone, sql(explainSql))
+
+ interceptContains[AccessControlException](
+ doAs(someone, sql(s"SELECT id FROM $db1.$table1").collect()))(
+ s"does not have [select] privilege on [$db1/$table1/id]")
Review Comment:
Here to verify after explain command, new command will check privilege
--
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]