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/13 09:46:40 UTC
[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #2648: [KYUUBI #2596] Support to control the viewing permissions of databases/tables/views/columns
yaooqinn commented on code in PR #2648:
URL: https://github.com/apache/incubator-kyuubi/pull/2648#discussion_r872200028
##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RuleReplaceShowObjectCommands.scala:
##########
@@ -17,26 +17,33 @@
package org.apache.kyuubi.plugin.spark.authz.ranger
+import scala.collection.mutable.ArrayBuffer
+
import org.apache.hadoop.security.UserGroupInformation
import org.apache.spark.sql.{Row, SparkSession}
+import org.apache.spark.sql.catalyst.analysis.ResolvedNamespace
import org.apache.spark.sql.catalyst.expressions.Attribute
-import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
+import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, ShowNamespaces}
import org.apache.spark.sql.catalyst.rules.Rule
-import org.apache.spark.sql.execution.command.RunnableCommand
+import org.apache.spark.sql.catalyst.util.{quoteIfNeeded, StringUtils}
+import org.apache.spark.sql.connector.catalog.{CatalogExtension, CatalogPlugin, SupportsNamespaces}
+import org.apache.spark.sql.execution.command.{RunnableCommand, ShowColumnsCommand}
import org.apache.kyuubi.plugin.spark.authz.{ObjectType, OperationType}
-import org.apache.kyuubi.plugin.spark.authz.util.{AuthZUtils, ObjectFilterPlaceHolder, WithInternalChild}
+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)
// show databases in spark2.4.x
case r: RunnableCommand if r.nodeName == "ShowDatabasesCommand" =>
FilteredShowDatabasesCommand(r)
- case n: LogicalPlan if n.nodeName == "ShowNamespaces" =>
Review Comment:
why changing this?
--
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