You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/05/06 05:32:06 UTC
[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #2535: [KYUUBI #2474] [Improvement] Add FilteredShowFunctionsCommand to Authz module
yaooqinn commented on code in PR #2535:
URL: https://github.com/apache/incubator-kyuubi/pull/2535#discussion_r866500809
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RangerSparkExtensionSuite.scala:
##########
@@ -273,6 +273,30 @@ abstract class RangerSparkExtensionSuite extends KyuubiFunSuite with SparkSessio
doAs("admin", sql(s"DROP DATABASE IF EXISTS $db"))
}
}
+
+ test("show functions") {
+ val default = "default"
+ val db3 = "default3"
+ val function1 = "function1"
+ try {
+ doAs("admin", sql(s"CREATE FUNCTION $function1 AS 'Function1'"))
+ doAs("admin", assert(sql(s"show user functions $default.$function1").collect().length == 1))
+ doAs("bob", assert(sql(s"show user functions $default.$function1").collect().length == 0))
+
+ doAs("admin", sql(s"CREATE DATABASE IF NOT EXISTS $db3"))
+ doAs("admin", sql(s"CREATE FUNCTION $db3.$function1 AS 'Function1'"))
+
+ doAs("admin", assert(sql(s"show user functions $db3.$function1").collect().length == 1))
+ doAs("bob", assert(sql(s"show user functions $db3.$function1").collect().length == 0))
+
+ doAs("admin", assert(sql(s"show system functions").collect().length > 0))
+ doAs("bob", assert(sql(s"show system functions").collect().length === 0))
Review Comment:
the builtin functions shall have open ACLs
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org