vrjdev opened a new pull request, #58674:
URL: https://github.com/apache/spark/pull/58674

   ### What changes were proposed in this pull request?
   
   Adds a test to `RestrictedModeSuite` verifying that the restricted SQL 
execution mode (SPARK-59319) rejects banned functions (`reflect` / 
`java_method` / `try_reflect`) when they are nested inside subqueries — both 
`EXISTS` and scalar subqueries — asserting 
`UNSUPPORTED_FEATURE.SQL_RESTRICTED_MODE`, plus a mode-off control. No 
production code is changed.
   
   ### Why are the changes needed?
   
   The restricted-mode gate promises banned features "cannot slip through": it 
walks the whole plan including `SubqueryExpression` plans. That traversal 
branch had zero coverage — the existing suite only exercises top-level calls, 
top-level TRANSFORM, and analyzed-subplan reuse. A regression there would fail 
silently (banned code runs, no test goes red), which is the worst failure mode 
for a security gate. Subqueries are also the most natural place to hide a 
banned call from a top-level-only check.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   New test `restricted mode rejects banned functions nested in subqueries` in 
`RestrictedModeSuite` (analysis-only, no session needed):
   ```
   build/sbt 'catalyst/testOnly 
org.apache.spark.sql.catalyst.analysis.RestrictedModeSuite'
   ```
   Result: Tests: succeeded 4, failed 0 (3 existing + 1 new).
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: MetaCode


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