Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KYUUBI #5472] Permanent View should pass column when child plan no o…
…utput ### _Why are the changes needed?_ To close #5472 For cases such as `SELECT COUNT(*) FORM XXX`, when `XXX` is table, will extract table's column, if `XXX` is view, only pass the view name ``` test("[KYUUBI #xxx] ") { val db1 = defaultDb val table1 = "table1" val view1 = "view1" withSingleCallEnabled { withCleanTmpResources(Seq((s"$db1.$table1", "table"), (s"$db1.$view1", "view"))) { doAs(admin, sql(s"CREATE TABLE IF NOT EXISTS $db1.$table1 (id int, scope int)")) doAs(admin, sql(s"CREATE VIEW $db1.$view1 AS SELECT * FROM $db1.$table1")) val e1 = intercept[AccessControlException]( doAs(someone, sql(s"SELECT count(*) FROM $db1.$table1").show())) assert(e1.getMessage.contains( s"does not have [select] privilege on [$db1/$table1/id,$db1/$table1/scope]")) val e2 = intercept[AccessControlException]( doAs(someone, sql(s"SELECT count(*) FROM $db1.$view1").show())) assert(e2.getMessage.contains( s"does not have [select] privilege on [$db1/$view1]")) } } } ``` After this pr, view will also extract columns. ### _How was this patch tested?_ - [x] 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](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request ### _Was this patch authored or co-authored using generative AI tooling?_ No Closes #5473 from AngersZhuuuu/KYUUBI-5742. Closes #5472 6575ad2 [Angerszhuuuu] Update RangerSparkExtensionSuite.scala 8a264a8 [Angerszhuuuu] Update afa43d3 [Angerszhuuuu] Merge branch 'master' into KYUUBI-5742 9f0bfb2 [Angerszhuuuu] Merge branch 'master' into KYUUBI-5742 2757844 [Angerszhuuuu] Update RangerSparkExtensionSuite.scala 88f3d32 [Angerszhuuuu] Merge branch 'master' into KYUUBI-5742 cd62c8d [Angerszhuuuu] update 55be7da [Angerszhuuuu] Update RangerSparkExtensionSuite.scala 4200ed3 [Angerszhuuuu] [KYUUBI #5742] Permanent View should pass column when child plan no output Authored-by: Angerszhuuuu <[email protected]> Signed-off-by: Kent Yao <[email protected]>
- Loading branch information