bowenliang123 commented on code in PR #5287:
URL: https://github.com/apache/kyuubi/pull/5287#discussion_r1355970911


##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/HudiCatalogRangerSparkExtensionSuite.scala:
##########
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kyuubi.plugin.spark.authz.ranger
+
+import org.apache.spark.SparkConf
+import org.scalatest.Outcome
+
+import org.apache.kyuubi.Utils
+import org.apache.kyuubi.plugin.spark.authz.AccessControlException
+import org.apache.kyuubi.plugin.spark.authz.RangerTestNamespace._
+import org.apache.kyuubi.plugin.spark.authz.RangerTestUsers._
+import org.apache.kyuubi.plugin.spark.authz.util.AuthZUtils._
+import org.apache.kyuubi.tags.HudiTest
+import org.apache.kyuubi.util.AssertionUtils.interceptContains
+
+/**
+ * Tests for RangerSparkExtensionSuite on Hudi SQL.
+ * Run this test should enbale `hudi` profile.
+ */
+@HudiTest
+class HudiCatalogRangerSparkExtensionSuite extends RangerSparkExtensionSuite {
+  override protected val catalogImpl: String = "hive"
+  override protected val sqlExtensions: String =
+    if (isSparkV31OrGreater && !isSparkV35OrGreater && !isScalaV213OrGreater) {
+      "org.apache.spark.sql.hudi.HoodieSparkSessionExtension"
+    } else {
+      ""
+    }
+
+  override protected val extraSparkConf: SparkConf =
+    new SparkConf()
+      .set("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
+
+  val namespace1 = hoodieNamespace
+  val table1 = "table1_hoodie"
+  val table2 = "table2_hoodie"
+  val outputTable1 = "outputTable_hoodie"
+
+  override def withFixture(test: NoArgTest): Outcome = {
+    assume(isSparkV31OrGreater && !isSparkV35OrGreater && 
!isScalaV213OrGreater)
+    test()
+  }
+
+  override def beforeAll(): Unit = {
+    if (isSparkV31OrGreater && !isSparkV35OrGreater && !isScalaV213OrGreater) {
+      if (isSparkV32OrGreater) {
+        spark.conf.set(
+          s"spark.sql.catalog.$sparkCatalog",
+          "org.apache.spark.sql.hudi.catalog.HoodieCatalog")
+        spark.conf.set(s"spark.sql.catalog.$sparkCatalog.type", "hadoop")
+        spark.conf.set(
+          s"spark.sql.catalog.$sparkCatalog.warehouse",
+          Utils.createTempDir("hoodie-hadoop").toString)
+      }
+      super.beforeAll()
+    }
+  }
+
+  override def afterAll(): Unit = {
+    if (isSparkV31OrGreater && !isSparkV35OrGreater && !isScalaV213OrGreater) {
+      super.afterAll()
+      spark.sessionState.catalog.reset()
+      spark.sessionState.conf.clear()
+    }
+  }
+
+  test("[KYUUBI #5284] Kyuubi authz support Hoodie Alter Table Command") {

Review Comment:
   ```suggestion
     test("AlterTableCommand") {
   ```
   A shorter name is enough. And consider split cases into several UTs. Just 
like other tests for different ALTER table operation in other Authz suites.



-- 
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