Commit 711b3b6
[KYUUBI #7568][AUTHZ] Eliminate TypeOfPlaceHolder across the whole plan
### Why are the changes needed?
Fixes #7568.
`RuleApplyTypeOfMarker` marks every `TypeOf` in the whole plan (`transformAllExpressions`), but since #5997 `RuleEliminateTypeOf` reverts them with `transformExpressionsUp`, which only visits the root node's expressions. A `TypeOfPlaceHolder` below the root — under `Sort`, `Union`, `Aggregate`, or a subquery — survives into execution and fails with `CLASS_NOT_OVERRIDE_EXPECTED_METHOD`, since it implements `doGenCode` but no `eval`.
This change uses `transformAllExpressions` on the eliminating side as well, so both rules cover the same scope in a single pass.
Affects 1.9.0 onwards, including master.
### How was this patch tested?
Added a test to `RangerSparkExtensionSuite` covering the root shapes the existing `Project`-root-only test misses: `Sort`, `Union`, `Aggregate`, and a subquery. It fails on master and passes with this change. Full `extensions/spark/kyuubi-spark-authz` suite: 657 passed, 0 failed.
### Was this patch authored or co-authored using generative AI tooling?
Assisted-by: Claude:claude-opus-4-8
Closes #7569 from j1wonpark/fix/authz-eliminate-typeof-whole-plan.
Closes #7568
38464f1 [Jiwon Park] Sort collected rows in the UNION ALL case to avoid order dependency while keeping Union as the root node
9ffea2d [Jiwon Park] [KYUUBI #7568][AUTHZ] Eliminate TypeOfPlaceHolder across the whole plan
Authored-by: Jiwon Park <jpark92@outlook.kr>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit 8fe59c5)
Signed-off-by: Cheng Pan <chengpan@apache.org>1 parent c8d2d1e commit 711b3b6
2 files changed
Lines changed: 57 additions & 1 deletion
File tree
- extensions/spark/kyuubi-spark-authz/src
- main/scala/org/apache/kyuubi/plugin/spark/authz/rule
- test/scala/org/apache/kyuubi/plugin/spark/authz/ranger
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1344 | 1344 | | |
1345 | 1345 | | |
1346 | 1346 | | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
1347 | 1399 | | |
1348 | 1400 | | |
1349 | 1401 | | |
| |||
0 commit comments