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/10 15:49:29 UTC

[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #2623: [KYUUBI #2438] Ranger AccessResource get database from spark catalog when database isnull

yaooqinn commented on code in PR #2623:
URL: https://github.com/apache/incubator-kyuubi/pull/2623#discussion_r869414308


##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/AccessResource.scala:
##########
@@ -40,11 +41,20 @@ object AccessResource {
 
   def apply(
       objectType: ObjectType,
-      firstLevelResource: String,
+      firstLevelResourceOrNull: String,
       secondLevelResource: String,
-      thirdLevelResource: String): AccessResource = {
+      thirdLevelResource: String,
+      spark: SparkSession = null): AccessResource = {
     val resource = new AccessResource(objectType)
 
+    val firstLevelResource =
+      if (spark != null
+        && (firstLevelResourceOrNull == null || firstLevelResourceOrNull.isEmpty)) {
+        spark.catalog.currentDatabase

Review Comment:
   why session catalog?how about other catalog implementations



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