Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUTHZ] Refactor Authz reflection with kyuubi-util's DynMethods #4873

Closed
wants to merge 3 commits into from

Conversation

bowenliang123
Copy link
Contributor

@bowenliang123 bowenliang123 commented May 22, 2023

Why are the changes needed?

  • add reflection utils in kyuubi-util-scala, using kyuubi-util's DynMethods
  • continue to provided simplified reflection calling in scala

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before make a pull request

@bowenliang123 bowenliang123 marked this pull request as ready for review May 22, 2023 17:06
@bowenliang123 bowenliang123 changed the title Refactor Authz reflection with kyuubi-util's DynMethods [AUTHZ] Refactor Authz reflection with kyuubi-util's DynMethods May 23, 2023
@codecov-commenter
Copy link

codecov-commenter commented May 23, 2023

Codecov Report

Merging #4873 (d0a5084) into master (aee9b94) will not change coverage.
The diff coverage is 0.00%.

@@          Coverage Diff           @@
##           master   #4873   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files         556     556           
  Lines       30697   30677   -20     
  Branches     4000    3996    -4     
======================================
+ Misses      30697   30677   -20     
Impacted Files Coverage Δ
.../kyuubi/plugin/spark/authz/PrivilegesBuilder.scala 0.00% <ø> (ø)
...uubi/plugin/spark/authz/ranger/AccessRequest.scala 0.00% <ø> (ø)
...k/authz/ranger/RuleReplaceShowObjectCommands.scala 0.00% <0.00%> (ø)
...e/kyuubi/plugin/spark/authz/serde/Descriptor.scala 0.00% <ø> (ø)
...i/plugin/spark/authz/serde/catalogExtractors.scala 0.00% <ø> (ø)
.../plugin/spark/authz/serde/databaseExtractors.scala 0.00% <ø> (ø)
...ubi/plugin/spark/authz/serde/tableExtractors.scala 0.00% <ø> (ø)
...he/kyuubi/plugin/spark/authz/util/AuthZUtils.scala 0.00% <ø> (ø)
...plugin/spark/authz/util/RangerConfigProvider.scala 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bowenliang123
Copy link
Contributor Author

bowenliang123 commented May 23, 2023

The lineage plugin would also benefit from this in follow-ups since it has similar reflection methods as Authz's.

@bowenliang123
Copy link
Contributor Author

Pending this PR. Local builds failed unexpectedly.

Running build/mvn clean package -pl :kyuubi-spark-authz_2.12 -Dranger.version=2.1.0

object ReflectUtils is not a member of package org.apache.kyuubi.util.reflect
...
package java.lang.invoke is not a value
...
not found: value getFieldVal
...
not found: value invokeAs

@pan3793
Copy link
Member

pan3793 commented May 23, 2023

please add -am in the command

@bowenliang123 bowenliang123 changed the title [AUTHZ] Refactor Authz reflection with kyuubi-util's DynMethods [WIP] [AUTHZ] Refactor Authz reflection with kyuubi-util's DynMethods May 23, 2023
@bowenliang123
Copy link
Contributor Author

OK. Built and tested successfully by running with -am.

@bowenliang123 bowenliang123 changed the title [WIP] [AUTHZ] Refactor Authz reflection with kyuubi-util's DynMethods [AUTHZ] Refactor Authz reflection with kyuubi-util's DynMethods May 23, 2023
@bowenliang123 bowenliang123 added this to the v1.8.0 milestone May 23, 2023
@pan3793 pan3793 closed this in 320178b May 23, 2023
@pan3793
Copy link
Member

pan3793 commented May 23, 2023

Thanks, merged to master

@bowenliang123 bowenliang123 deleted the authz-reflect branch May 23, 2023 07:28
huangzhir pushed a commit to huangzhir/kyuubi that referenced this pull request May 30, 2023
…il's DynMethods

### _Why are the changes needed?_

- add reflection utils in kyuubi-util-scala, using kyuubi-util's DynMethods
- continue to provided simplified reflection calling in scala

### _How was this patch tested?_
- [ ] 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.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes apache#4873 from bowenliang123/authz-reflect.

Closes apache#4873

d0a5084 [liangbowen] import
95d4760 [Cheng Pan] Update kyuubi-util-scala/src/main/scala/org/apache/kyuubi/util/reflect/ReflectUtils.scala
83e70f0 [liangbowen] authz reflect

Lead-authored-by: liangbowen <liangbowen@gf.com.cn>
Co-authored-by: Cheng Pan <pan3793@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants