wankunde opened a new pull request, #6758: URL: https://github.com/apache/kyuubi/pull/6758
# :mag: Description ## Issue References ๐ This pull request fixes #6754 ## Describe Your Solution ๐ง Right now in RuleAuthorization we use an ArrayBuffer to collect access requests, which is very slow because each new PrivilegeObject needs to be compared with all access requests. ## Types of changes :bookmark: - [x] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan ๐งช #### Behavior Without This Pull Request :coffin:  #### Behavior With This Pull Request :tada:  #### Related Unit Tests Test with local 50000 files: ```java test("KYUUBI #6754: improve the performance of ranger access requests") { val outputPath = "/private/var/folders/tr/scn8dgl13_l6_sh17bghtln1b35kn1/T/kyuubi-test-5492934124608743789/" println("output path: "+ outputPath) val plugin = mock[SparkRangerAdminPlugin.type] when(plugin.verify(Seq(any[RangerAccessRequest]), any[SparkRangerAuditHandler])) .thenAnswer(_ => ()) val df = spark.read.parquet(outputPath + "/*/*.parquet") val plan = df.queryExecution.optimizedPlan val start = System.currentTimeMillis() RuleAuthorization(spark).checkPrivileges(spark, plan) val end = System.currentTimeMillis() println(s"Time elapsed : ${end - start} ms") } ``` --- # Checklist ๐ <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) **Be nice. Be informative.** -- 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