This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 7fca42a63 [KYUUBI #3424][FOLLOWUP] Remove duplicate 
DropNamespace/MergeIntoTable in v2commands
7fca42a63 is described below

commit 7fca42a631578b4fa0b92e805fdc84997d89d53e
Author: Bowen Liang <[email protected]>
AuthorDate: Mon Oct 17 09:54:49 2022 +0800

    [KYUUBI #3424][FOLLOWUP] Remove duplicate DropNamespace/MergeIntoTable in 
v2commands
    
    ### _Why are the changes needed?_
    
    - remove duplicate and shadowed v2Commands `DropNamespace` and 
`MergeIntoTable` from `PrivilegesBuilder`, since they are already implemented 
in #3424 .
    
    ### _How was this patch tested?_
    - [x] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run 
test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests)
 locally before make a pull request
    
    Closes #3639 from bowenliang123/3424-followup2.
    
    Closes #3424
    
    232dd751 [Bowen Liang] remove `DropNamespace` and `MergeIntoTable` in 
`PrivilegesBuilder` which shadowed and implemented in v2Commands.scala
    
    Authored-by: Bowen Liang <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
---
 .../org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala   | 7 -------
 .../authz/ranger/V2JdbcTableCatalogRangerSparkExtensionSuite.scala | 2 --
 2 files changed, 9 deletions(-)

diff --git 
a/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala
 
b/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala
index 49fbe6042..b74e68940 100644
--- 
a/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala
+++ 
b/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/PrivilegesBuilder.scala
@@ -391,11 +391,6 @@ object PrivilegesBuilder {
         val func = getPlanField[FunctionIdentifier]("functionName")
         inputObjs += functionPrivileges(func.database.orNull, func.funcName)
 
-      case "DropNamespace" =>
-        val child = getPlanField[Any]("namespace")
-        val database = getFieldVal[Seq[String]](child, "namespace")
-        outputObjs += databasePrivileges(quote(database))
-
       case "DropTableCommand" =>
         if (!isTempView(getPlanField[TableIdentifier]("tableName"), spark)) {
           outputObjs += tablePrivileges(getTableName)
@@ -436,8 +431,6 @@ object PrivilegesBuilder {
           .map(_.keySet).getOrElse(Nil)
         outputObjs += tablePrivileges(table, cols.toSeq, actionType = 
actionType)
 
-      case "MergeIntoTable" =>
-
       case "RepairTableCommand" =>
         val enableAddPartitions = getPlanField[Boolean]("enableAddPartitions")
         if (enableAddPartitions) {
diff --git 
a/extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/V2JdbcTableCatalogRangerSparkExtensionSuite.scala
 
b/extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/V2JdbcTableCatalogRangerSparkExtensionSuite.scala
index 41cd6d8a6..6bdab9d9d 100644
--- 
a/extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/V2JdbcTableCatalogRangerSparkExtensionSuite.scala
+++ 
b/extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/V2JdbcTableCatalogRangerSparkExtensionSuite.scala
@@ -259,7 +259,6 @@ class V2JdbcTableCatalogRangerSparkExtensionSuite extends 
RangerSparkExtensionSu
   test("[KYUUBI #3424] TRUNCATE TABLE") {
     assume(isSparkV32OrGreater)
 
-    // CreateView with select
     val e1 = intercept[AccessControlException](
       doAs(
         "someone",
@@ -271,7 +270,6 @@ class V2JdbcTableCatalogRangerSparkExtensionSuite extends 
RangerSparkExtensionSu
   test("[KYUUBI #3424] MSCK REPAIR TABLE") {
     assume(isSparkV32OrGreater)
 
-    // CreateView with select
     val e1 = intercept[AccessControlException](
       doAs(
         "someone",

Reply via email to