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/10/17 13:17:21 UTC

[GitHub] [incubator-kyuubi] packyan commented on a diff in pull request #3593: [KYUUBI #3592] Spark SQL authz only consider persistent functions

packyan commented on code in PR #3593:
URL: https://github.com/apache/incubator-kyuubi/pull/3593#discussion_r997049147


##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala:
##########
@@ -83,6 +84,27 @@ object PrivilegesBuilder {
     spark.sessionState.catalog.isTempView(parts)
   }
 
+  private def isPersistentFunction(
+      functionIdent: FunctionIdentifier,
+      spark: SparkSession): Boolean = {
+    val (db, funcName) = functionIdent.database match {
+      case Some(db) =>
+        (db, functionIdent.funcName)
+      case _ =>
+        Try {
+          spark.sessionState.catalog.lookupFunctionInfo(functionIdent)

Review Comment:
   sounds reasonable, when db is missing, we use current db to check wheather it's persistent. 
   `spark.sessionState.catalog.isPersistentFunction(FunctionIdentifier(funcName, database.or(spark.catalog.currentDatabase)))`



-- 
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