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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to