-
Notifications
You must be signed in to change notification settings - Fork 919
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
[KYUUBI #5594][AUTHZ] BuildQuery should respect normal node's input #5627
Conversation
…t-normal-node's-input
s"does not have [select] privilege on [$db1/$table1/id,$db1/$table1/scope]") | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a UT, the plan is
GlobalLimit 1
+- LocalLimit 1
+- Project [cast(id#22 as string) AS id#30, cast(scope#23 as string) AS scope#31]
+- MapInPandas mapInPandasUDF(id#17, scope#18)#21, [id#22, scope#23]
+- HiveTableRelation [`spark_catalog`.`default`.`table1`, org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, Data Cols: [id#17, scope#18], Partition Cols: []]
Without this pr, this query only extract table, miss column privilege
"Permission denied: user [someone] does not have [select] privilege on [default/table1]" did not contain "does not have [select] privilege on [default/table1/id,default/table1/scope]"
ScalaTestFailureLocation: org.apache.kyuubi.plugin.spark.authz.ranger.HiveCatalogRangerSparkExtensionSuite at (RangerSparkExtensionSuite.scala:1125)
org.scalatest.exceptions.TestFailedException: "Permission denied: user [someone] does not have [select] privilege on [default/table1]" did not contain "does not have [select] privilege on [default/table1/id,default/table1/scope]"
at org.scalatest.Assertions.newAssertionFailedException(Assertions.scala:472)
ping @yaooqinn |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5627 +/- ##
============================================
+ Coverage 61.35% 61.38% +0.02%
Complexity 23 23
============================================
Files 607 607
Lines 35935 35946 +11
Branches 4936 4937 +1
============================================
+ Hits 22047 22064 +17
Misses 11498 11498
+ Partials 2390 2384 -6 ☔ View full report in Codecov by Sentry. |
ping @yaooqinn Could you take a review? |
we have test for aggs, why do they not fail after this change |
This PR is just a supplement to some special plan cases. Make sure we get all the projection list. For below plan
if we only extract the We can see plan
|
Change some code to make it more simple cc @yaooqinn |
Thanks for the PR! This PR is being closed due to inactivity. This isn't a judgement on the merit of the PR in any way. If this is still an issue with the latest version of Kyuubi, please reopen it and ask a committer to remove the Stale tag! Thank you for using Kyuubi! |
Why are the changes needed?
To close #5594
For case
The logical plan is
When handle
MapInPandas
, we didn't match its input withHiveTableRelation
, cause we miss input table's columns. This pr fix thisHow 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
With this patch, it can extract the correct privilege object now
Was this patch authored or co-authored using generative AI tooling?