pan3793 commented on code in PR #6758:
URL: https://github.com/apache/kyuubi/pull/6758#discussion_r1806471769


##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RuleAuthorization.scala:
##########
@@ -34,23 +35,22 @@ case class RuleAuthorization(spark: SparkSession) extends 
Authorization(spark) {
     val auditHandler = new SparkRangerAuditHandler
     val ugi = getAuthzUgi(spark.sparkContext)
     val (inputs, outputs, opType) = PrivilegesBuilder.build(plan, spark)
-    val requests = new ArrayBuffer[AccessRequest]()
+    var requests = new HashMap[(AccessResource, AccessType), AccessRequest]()

Review Comment:
   Why `immutable.HashMap` instead of `mutable.HashMap` is used here?
   
   BTW, Scala 2.13 changed the alias of `HashMap` from `mutable.HashMap` to 
`immutable.HashMap`, to make the code clear, please write `new 
immutable.HashMap` or use `new mutable.HashMap` inline



##########
extensions/spark/kyuubi-spark-authz/pom.xml:
##########
@@ -380,6 +380,19 @@
             <artifactId>${hudi.artifact}</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.scalatestplus</groupId>
+            <artifactId>mockito-4-11_${scala.binary.version}</artifactId>
+            <version>${scalatestplus.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-inline</artifactId>
+            <version>${mockito.version}</version>

Review Comment:
   ```suggestion
   ```



##########
extensions/spark/kyuubi-spark-authz/pom.xml:
##########
@@ -380,6 +380,19 @@
             <artifactId>${hudi.artifact}</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.scalatestplus</groupId>
+            <artifactId>mockito-4-11_${scala.binary.version}</artifactId>
+            <version>${scalatestplus.version}</version>

Review Comment:
   ```suggestion
   ```



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