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/17 07:50:48 UTC

[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #2675: Fix compatibility for spark authz with spark v3.3

yaooqinn commented on code in PR #2675:
URL: https://github.com/apache/incubator-kyuubi/pull/2675#discussion_r874483503


##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala:
##########
@@ -447,16 +473,42 @@ object PrivilegesBuilder {
         val table = getPlanField[TableIdentifier]("table")
         inputObjs += tablePrivileges(table)
 
+      case "ShowTableProperties" =>
+        val resolvedTable = getPlanField[Any]("table")
+        val identifier = getFieldVal[AnyRef](resolvedTable, "identifier")
+        val namespace = invoke(identifier, "namespace").asInstanceOf[Array[String]]
+        val table = invoke(identifier, "name").asInstanceOf[String]
+        inputObjs += PrivilegeObject(
+          TABLE_OR_VIEW,
+          PrivilegeObjectActionType.OTHER,
+          quote(namespace),
+          table,
+          Nil)
+
+      case "ShowCreateTable" =>
+        val resolvedTable = getPlanField[Any]("child")
+        val identifier = getFieldVal[AnyRef](resolvedTable, "identifier")
+        val namespace = invoke(identifier, "namespace").asInstanceOf[Array[String]]
+        val table = invoke(identifier, "name").asInstanceOf[String]
+        inputObjs += PrivilegeObject(
+          TABLE_OR_VIEW,
+          PrivilegeObjectActionType.OTHER,
+          quote(namespace),
+          table,
+          Nil)
+
       case "ShowFunctionsCommand" =>
-        getPlanField[Option[String]]("db").foreach { db =>
-          inputObjs += databasePrivileges(db)
-        }

Review Comment:
   using filtered command instead of 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