j1wonpark opened a new pull request, #7856:
URL: https://github.com/apache/kyuubi/pull/7856

   ### Why are the changes needed?
   
   Fixes #7855. Follow-up to #7739.
   
   Fresh analysis assigns new CTE IDs inside permanent views. Spark's 
`NormalizeCTEIds` cannot traverse `PermanentViewMarker`, so equivalent queries 
miss the cache and unpersist through fresh analysis leaves the original entry 
cached.
   
   Normalize CTE IDs within the enclosing view for cache-key comparison, 
including nested views and subqueries. Preserve authorization markers in the 
analyzed plan and remain compatible with runtimes without the normalization 
rule.
   
   ### How was this patch tested?
   
   Added four independent tests for CTE-view cache reuse, nested views, 
subqueries referencing an enclosing CTE, and unpersist through fresh analysis. 
All four fail without the production fix.
   
   Ran `PermanentViewMarkerSuite` and `HiveCatalogRangerSparkExtensionSuite`:
   
   - Spark 4.1.4 / Scala 2.13: 61 passed.
   - Spark 3.5.8 / Scala 2.12 and Spark 4.0.3 / Scala 2.13: 57 passed each; 
four tests canceled because `NormalizeCTEIds` is unavailable.
   - `dev/reformat`, `spotless:check`, `scalastyle:check`, and `git diff 
--check` passed.
   
   Additional InMemory catalog suite checks encounter three `SHOW` failures 
with `RemoteClassLoaderError`, also reproduced without the production fix.
   
   ### Was this patch assisted by generative AI tooling?
   
   Assisted-by: Codex (GPT-6)
   


-- 
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]

Reply via email to