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/07 03:40:19 UTC
[GitHub] [incubator-kyuubi] zhaomin1423 commented on a diff in pull request #2580: [KYUUBI #2473] Add FilteredShowDatabasesCommand to AuthZ module
zhaomin1423 commented on code in PR #2580:
URL: https://github.com/apache/incubator-kyuubi/pull/2580#discussion_r867295610
##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RuleReplaceShowObjectCommands.scala:
##########
@@ -30,6 +30,8 @@ import org.apache.kyuubi.plugin.spark.authz.util.{AuthZUtils, WithInternalChild}
class RuleReplaceShowObjectCommands extends Rule[LogicalPlan] {
override def apply(plan: LogicalPlan): LogicalPlan = plan match {
case r: RunnableCommand if r.nodeName == "ShowTablesCommand" => FilteredShowTablesCommand(r)
+ case r: ShowNamespaces if r.nodeName == "ShowNamespaces" =>
Review Comment:
'if r.nodeName ...' is redundant.
##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RuleReplaceShowObjectCommands.scala:
##########
@@ -58,3 +60,28 @@ case class FilteredShowTablesCommand(delegated: RunnableCommand)
override def withNewChildrenInternal(newChildren: IndexedSeq[LogicalPlan]): LogicalPlan = this
}
+
+case class FilteredShowDatabasesCommand(delegated: ShowNamespaces) extends RunnableCommand
+ with WithInternalChild {
+
+ override val output: Seq[Attribute] = delegated.output
+
+ override def run(spark: SparkSession): Seq[Row] = {
+ val catalog = spark.sessionState.catalog
Review Comment:
ShowNamespaces's logical plan is ShowNamespacesExec, I don't know whether the result is same with your logical. you can add some test for catalog of datasourcev2, for example, iceberg or hudi.
--
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