j1wonpark opened a new pull request, #7739: URL: https://github.com/apache/kyuubi/pull/7739
### Why are the changes needed? Fixes #7738. `newInstance()` wraps the child in a `Project`, and three things kept that `Project` in the canonical form, so a renewed marker was not `sameResult` with the original and `CacheManager` could not find the cache. Dropping the `Cast` lets Spark's own rename-only `Project` stripping apply. That stripping arrived in SPARK-51109, so it is absent on 3.5; on 4.0 the backported condition requires `alias.explicitMetadata.isEmpty` and PVM passes `Some(attr.metadata)`, so it does not apply there either. The guard is the only mechanism on those two versions, hence both changes. Matching on the tag alone drops two conditions the guard does not need — that the child is a `View`, and that there is a single layer. Both are violated in practice: markers over subquery plans have a non-`View` child, and a renewed marker reused in another query gains a second `Project`. ### How was this patch tested? Three unit assertions in a new `PermanentViewMarkerSuite`, one per cause, and a plan level check next to `[KYUUBI #3411] skip checking cache table` in `RangerSparkExtensionSuite` that also covers the nested shape. | Spark | as shipped | `Cast` removed only | this patch | |---|---|---|---| | 3.5 | 3 of 3 fail | 2 of 3 fail | pass | | 4.0 | 3 of 3 fail | 2 of 3 fail | pass | | 4.1 | 3 of 3 fail | pass | pass | 70 tests pass on 3.5 and on 4.1 (`PermanentViewMarkerSuite` plus the Hive and in-memory catalog `RangerSparkExtensionSuite`), and the masking and row filtering suites are unchanged. ### Was this patch assisted by generative AI tooling? Assisted-by: Claude Opus 5 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
