You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "rwu-wish (via GitHub)" <gi...@apache.org> on 2023/03/03 08:16:44 UTC

[GitHub] [kyuubi] rwu-wish opened a new issue, #4441: [Bug] Spark authz extension (ranger) always deny createGlobalTempView

rwu-wish opened a new issue, #4441:
URL: https://github.com/apache/kyuubi/issues/4441

   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   
   
   ### Search before asking
   
   - [X] I have searched in the [issues](https://github.com/apache/kyuubi/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Describe the bug
   
   With spark authz extension enabled (Ranger plugin), the spark api `createGlobalTempView` seem to always get denied even though I have given my user full access on Ranger admin server.
   
   Reproduction steps:
   Spark version 3.3.0
   
   ```
   $ spark-shell
   
   val df = Seq(1,2,3).toDF("num")
   df.createGlobalTempView("tempview")
   ```
   
   ```
   org.apache.kyuubi.plugin.spark.authz.AccessControlException: Permission denied: user [hadoop] does not have [create] privilege on [tempview]
     at org.apache.kyuubi.plugin.spark.authz.ranger.RuleAuthorization$.verify(RuleAuthorization.scala:88)
     at org.apache.kyuubi.plugin.spark.authz.ranger.RuleAuthorization$.$anonfun$checkPrivileges$3(RuleAuthorization.scala:80)
     at org.apache.kyuubi.plugin.spark.authz.ranger.RuleAuthorization$.$anonfun$checkPrivileges$3$adapted(RuleAuthorization.scala:71)
     at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
     at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
     at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
     at org.apache.kyuubi.plugin.spark.authz.ranger.RuleAuthorization$.checkPrivileges(RuleAuthorization.scala:71)
     at org.apache.kyuubi.plugin.spark.authz.ranger.RuleAuthorization.apply(RuleAuthorization.scala:35)
     at org.apache.kyuubi.plugin.spark.authz.ranger.RuleAuthorization.apply(RuleAuthorization.scala:32)
     at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$execute$1(RuleExecutor.scala:215)
     at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
     at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
     at scala.collection.immutable.List.foldLeft(List.scala:91)
     at org.apache.spark.sql.catalyst.rules.RuleExecutor.executeBatch$1(RuleExecutor.scala:212)
     at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$execute$6(RuleExecutor.scala:284)
     at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
     at org.apache.spark.sql.catalyst.rules.RuleExecutor$RuleExecutionContext$.withContext(RuleExecutor.scala:327)
     at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$execute$5(RuleExecutor.scala:284)
     at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$execute$5$adapted(RuleExecutor.scala:274)
     at scala.collection.immutable.List.foreach(List.scala:431)
     at org.apache.spark.sql.catalyst.rules.RuleExecutor.execute(RuleExecutor.scala:274)
     at org.apache.spark.sql.catalyst.rules.RuleExecutor.execute(RuleExecutor.scala:188)
     at org.apache.spark.sql.catalyst.rules.RuleExecutor.$anonfun$executeAndTrack$1(RuleExecutor.scala:179)
     at org.apache.spark.sql.catalyst.QueryPlanningTracker$.withTracker(QueryPlanningTracker.scala:107)
     at org.apache.spark.sql.catalyst.rules.RuleExecutor.executeAndTrack(RuleExecutor.scala:179)
     at org.apache.spark.sql.execution.QueryExecution.$anonfun$optimizedPlan$1(QueryExecution.scala:134)
     at org.apache.spark.sql.catalyst.QueryPlanningTracker.measurePhase(QueryPlanningTracker.scala:192)
     at org.apache.spark.sql.execution.QueryExecution.$anonfun$executePhase$2(QueryExecution.scala:213)
     at org.apache.spark.sql.execution.QueryExecution$.withInternalError(QueryExecution.scala:552)
     at org.apache.spark.sql.execution.QueryExecution.$anonfun$executePhase$1(QueryExecution.scala:213)
     at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:779)
     at org.apache.spark.sql.execution.QueryExecution.executePhase(QueryExecution.scala:212)
     at org.apache.spark.sql.execution.QueryExecution.optimizedPlan$lzycompute(QueryExecution.scala:130)
     at org.apache.spark.sql.execution.QueryExecution.optimizedPlan(QueryExecution.scala:126)
     at org.apache.spark.sql.execution.QueryExecution.$anonfun$writePlans$4(QueryExecution.scala:296)
     at org.apache.spark.sql.catalyst.plans.QueryPlan$.append(QueryPlan.scala:657)
     at org.apache.spark.sql.execution.QueryExecution.writePlans(QueryExecution.scala:296)
     at org.apache.spark.sql.execution.QueryExecution.toString(QueryExecution.scala:313)
     at org.apache.spark.sql.execution.QueryExecution.org$apache$spark$sql$execution$QueryExecution$$explainString(QueryExecution.scala:267)
     at org.apache.spark.sql.execution.QueryExecution.explainString(QueryExecution.scala:246)
     at org.apache.spark.sql.execution.SQLExecution$.executeQuery$1(SQLExecution.scala:107)
     at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$7(SQLExecution.scala:139)
     at org.apache.spark.sql.catalyst.QueryPlanningTracker$.withTracker(QueryPlanningTracker.scala:107)
     at org.apache.spark.sql.execution.SQLExecution$.withTracker(SQLExecution.scala:224)
     at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$6(SQLExecution.scala:139)
     at org.apache.spark.sql.execution.SQLExecution$.withSQLConfPropagated(SQLExecution.scala:245)
     at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$1(SQLExecution.scala:138)
     at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:779)
     at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:68)
     at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.applyOrElse(QueryExecution.scala:100)
     at org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.applyOrElse(QueryExecution.scala:96)
     at org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$transformDownWithPruning$1(TreeNode.scala:615)
   
   ```
   
   The same steps work on spark 3.1.2 with the spark ranger plugin from the previous project submarine
   https://submarine.apache.org/docs/0.6.0/userDocs/submarine-security/spark-security/build-submarine-spark-security-plugin/
   
   org.apache.submarine.spark.security.api.RangerSparkSQLExtension
   
   ```
   Welcome to
         ____              __
        / __/__  ___ _____/ /__
       _\ \/ _ \/ _ `/ __/  '_/
      /___/ .__/\_,_/_/ /_/\_\   version 3.1.2-amzn-1
         /_/
            
   Using Scala version 2.12.10 (OpenJDK 64-Bit Server VM, Java 1.8.0_362)
   Type in expressions to have them evaluated.
   Type :help for more information.
   
   scala> val df = Seq(1,2,3).toDF("num")
   df: org.apache.spark.sql.DataFrame = [num: int]
   
   scala> df.show()
   +---+
   |num|
   +---+
   |  1|
   |  2|
   |  3|
   +---+
   
   
   scala> df.createOrReplaceTempView("tempview")
   23/03/03 08:00:15 WARN SimpleFunctionRegistry: The function mask replaced a previously registered function.
   23/03/03 08:00:15 WARN SimpleFunctionRegistry: The function mask_hash replaced a previously registered function.
   23/03/03 08:00:15 WARN SimpleFunctionRegistry: The function mask_first_n replaced a previously registered function.
   23/03/03 08:00:15 WARN SimpleFunctionRegistry: The function mask_last_n replaced a previously registered function.
   23/03/03 08:00:15 WARN SimpleFunctionRegistry: The function mask_show_last_n replaced a previously registered function.
   23/03/03 08:00:15 WARN SimpleFunctionRegistry: The function mask_show_first_n replaced a previously registered function.
   
   scala> spark.sql("select * from tempview").show()
   23/03/03 08:00:33 WARN SimpleFunctionRegistry: The function mask replaced a previously registered function.
   23/03/03 08:00:33 WARN SimpleFunctionRegistry: The function mask_hash replaced a previously registered function.
   23/03/03 08:00:33 WARN SimpleFunctionRegistry: The function mask_first_n replaced a previously registered function.
   23/03/03 08:00:33 WARN SimpleFunctionRegistry: The function mask_last_n replaced a previously registered function.
   23/03/03 08:00:33 WARN SimpleFunctionRegistry: The function mask_show_last_n replaced a previously registered function.
   23/03/03 08:00:33 WARN SimpleFunctionRegistry: The function mask_show_first_n replaced a previously registered function.
   +---+
   |num|
   +---+
   |  1|
   |  2|
   |  3|
   +---+
   
   ```
   
   ### Affects Version(s)
   
   1.6.1
   
   ### Kyuubi Server Log Output
   
   _No response_
   
   ### Kyuubi Engine Log Output
   
   _No response_
   
   ### Kyuubi Server Configurations
   
   _No response_
   
   ### Kyuubi Engine Configurations
   
   _No response_
   
   ### Additional context
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to fix.
   - [ ] No. I cannot submit a PR at this time.


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


[GitHub] [kyuubi] yaooqinn commented on issue #4441: [Bug] Spark authz extension (ranger) always deny createGlobalTempView

Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on issue #4441:
URL: https://github.com/apache/kyuubi/issues/4441#issuecomment-1453174749

   Can you help verify v1.7.0? https://lists.apache.org/thread/n6jlg1hqhdxjj35tw644ndbt2fbd1sjr


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


[GitHub] [kyuubi] rwu-wish commented on issue #4441: [Bug] Spark authz extension (ranger) always deny createGlobalTempView

Posted by "rwu-wish (via GitHub)" <gi...@apache.org>.
rwu-wish commented on issue #4441:
URL: https://github.com/apache/kyuubi/issues/4441#issuecomment-1453241696

   I just tried master branch , it seems working. Thanks I will resolve


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


[GitHub] [kyuubi] rwu-wish closed issue #4441: [Bug] Spark authz extension (ranger) always deny createGlobalTempView

Posted by "rwu-wish (via GitHub)" <gi...@apache.org>.
rwu-wish closed issue #4441: [Bug] Spark authz extension (ranger) always deny createGlobalTempView
URL: https://github.com/apache/kyuubi/issues/4441


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


[GitHub] [kyuubi] pan3793 commented on issue #4441: [Bug] Spark authz extension (ranger) always deny createGlobalTempView

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on issue #4441:
URL: https://github.com/apache/kyuubi/issues/4441#issuecomment-1453248349

   @rwu-wish thanks for the verification, Kyuubi 1.7.0 is voting, will appreciate it if you can reply in the mail listing. ([Reply via your own email client](mailto:dev@kyuubi.apache.org?subject=RE%3A%20%5BVOTE%5D%20Release%20Apache%20Kyuubi%20v1.7.0%20rc1&amp;In-Reply-To=%3CCABtRUgSL9Ff59zbrRv7gqefr4X6DY6OxgoOv3Aj3mCYy4jf9sg%40mail.gmail.com%3E&body=%0A%0AOn%202023%2F03%2F03%2004%3A08%3A48%20Cheng%20Pan%20wrote%3A%0A%3E%20Hello%20Apache%20Kyuubi%20PMC%20and%20Community%2C%0A%3E%20%0A%3E%20Please%20vote%20on%20releasing%20the%20following%20candidate%20as%0A%3E%20Apache%20Kyuubi%20version%20v1.7.0.%0A%3E%20%0A%3E%20The%20VOTE%20will%20remain%20open%20for%20at%20least%2072%20hours.%0A%3E%20%0A%3E%20%5B%20%5D%20%2B1%20Release%20this%20package%20as%20Apache%20Kyuubi%20v1.7.0%0A%3E%20%5B%20%5D%20%2B0%0A%3E%20%5B%20%5D%20-1%20Do%20not%20release%20this%20package%20because%20...%0A%3E%20%0A%3E%20To%20learn%20more%20about%20Apache%20Kyuubi%2C%20please%20see%0A%3E%20https%3A%2F%2Fkyuubi.apache
 .org%2F%0A%3E%20%0A%3E%20The%20tag%20to%20be%20voted%20on%20is%20v1.7.0-rc1%0A%3E%20(commit%202115839104dacd92e8050a069f1beaf6317fa26d)%3A%0A%3E%20https%3A%2F%2Fgithub.com%2Fapache%2Fkyuubi%2Ftree%2Fv1.7.0-rc1%0A%3E%20%0A%3E%20The%20release%20files%2C%20including%20signatures%2C%20digests%2C%20etc.%20can%20be%20found%20at%3A%0A%3E%20https%3A%2F%2Fdist.apache.org%2Frepos%2Fdist%2Fdev%2Fkyuubi%2Fv1.7.0-rc1%2F%0A%3E%20%0A%3E%20Signatures%20used%20for%20Kyuubi%20RCs%20can%20be%20found%20in%20this%20file%3A%0A%3E%20https%3A%2F%2Fdownloads.apache.org%2Fkyuubi%2FKEYS%0A%3E%20%0A%3E%20The%20staging%20repository%20for%20this%20release%20can%20be%20found%20at%3A%0A%3E%20https%3A%2F%2Frepository.apache.org%2Fcontent%2Frepositories%2Forgapachekyuubi-1028%2F%0A%3E%20%0A%3E%20The%20full%20changelog%20is%3A%0A%3E%20https%3A%2F%2Fgithub.com%2Fapache%2Fkyuubi%2Fcompare%2Fv1.6.0-incubating...v1.7.0-rc1%0A%3E%20%0A%3E%20Thanks%2C%0A%3E%20Cheng%20Pan%0A%3E%20On%20behalf%20of%20Apache%20Kyuubi%20communi
 ty%0A%3E%20))


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


[GitHub] [kyuubi] github-actions[bot] commented on issue #4441: [Bug] Spark authz extension (ranger) always deny createGlobalTempView

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #4441:
URL: https://github.com/apache/kyuubi/issues/4441#issuecomment-1453143547

   Hello @rwu-wish,
   Thanks for finding the time to report the issue!
   We really appreciate the community's efforts to improve Apache Kyuubi.


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