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/24 12:09:20 UTC
[GitHub] [incubator-kyuubi] packyan commented on a diff in pull request #2623: [KYUUBI #2438] Ranger AccessResource get database from spark catalog when database isnull
packyan commented on code in PR #2623:
URL: https://github.com/apache/incubator-kyuubi/pull/2623#discussion_r880423020
##########
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:
>
sorry, only consider the spark2.x, the support for spark3.x multi-catalog is committed, please review it, thx.
--
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