pan3793 commented on code in PR #6758: URL: https://github.com/apache/kyuubi/pull/6758#discussion_r1808025142
########## extensions/spark/kyuubi-spark-authz/pom.xml: ########## @@ -380,6 +380,14 @@ <artifactId>${hudi.artifact}</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.spark</groupId> + <artifactId>spark-core_${scala.binary.version}</artifactId> + <version>${spark.version}</version> Review Comment: no need to duplicate version in sub-modules' pom ```suggestion ``` ########## extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RuleAuthorization.scala: ########## @@ -34,15 +35,19 @@ 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]() + + // Use a HashSet to deduplicate the same AccessResource and AccessType, the requests will be all + // the non-duplicate requests. Review Comment: also mention the requirements of keep ordering ########## extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/spark/sql/RuleAuthorizationBenchmark.scala: ########## @@ -0,0 +1,96 @@ +/* + * 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.spark.sql + +import java.io.File +import java.nio.file.Files + +import scala.concurrent.ExecutionContext.Implicits.global +import scala.concurrent.Future +import scala.concurrent.duration.Duration +import scala.reflect.io.Path.jfile2path + +import org.apache.spark.benchmark.Benchmark +import org.scalatest.BeforeAndAfterAll +// scalastyle:off +import org.scalatest.funsuite.AnyFunSuite + +import org.apache.kyuubi.plugin.spark.authz.SparkSessionProvider +import org.apache.kyuubi.plugin.spark.authz.benchmark.KyuubiBenchmarkBase +import org.apache.kyuubi.plugin.spark.authz.ranger.RuleAuthorization +import org.apache.kyuubi.util.ThreadUtils + +/** + * Benchmark to measure performance of collecting ranger access requests. + * + * {{{ + * + * RUN_BENCHMARK=1 ./build/mvn clean test \ + * -pl extensions/spark/kyuubi-spark-authz -am \ + * -Pspark-3.3 \ + * -Dtest=none -DwildcardSuites=org.apache.spark.sql.RuleAuthorizationBenchmark Review Comment: authz module is activated unconditionally ```suggestion * RUN_BENCHMARK=1 ./build/mvn clean test \ * -pl extensions/spark/kyuubi-spark-authz -am \ * -Dtest=none -DwildcardSuites=org.apache.spark.sql.RuleAuthorizationBenchmark ``` -- 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-unsubscr...@kyuubi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@kyuubi.apache.org For additional commands, e-mail: notifications-h...@kyuubi.apache.org