dongjoon-hyun opened a new pull request, #56501:
URL: https://github.com/apache/spark/pull/56501

   ### What changes were proposed in this pull request?
   
   The Hive Thrift Server now rejects setting JVM system properties via the 
`set:system:` session config overlay (e.g. `set:system:foo=bar` in a JDBC URL), 
matching how the `env:*` prefix is already handled in 
`HiveSessionImpl.setVariable`.
   
   A new static config 
`spark.sql.legacy.hive.thriftServer.allowSettingSystemProperties` (default 
`false`) restores the old behavior when set to `true`. It is propagated into 
the session `HiveConf` in `SparkSQLSessionManager.init` so that `setVariable` 
can read it during session open.
   
   ### Why are the changes needed?
   
   The `set:system:` overlay lets an untrusted per-connection client mutate the 
shared Thrift Server's process-wide JVM state. The `env:*` prefix is already 
rejected for the same reason; `system:*` should be too.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. `set:system:` overlays (e.g. 
`jdbc:hive2://host:port/db?set:system:foo=bar`) are now rejected by default 
instead of applied. Set 
`spark.sql.legacy.hive.thriftServer.allowSettingSystemProperties` to `true` to 
restore the old behavior. Documented in `docs/sql-migration-guide.md`.
   
   ### How was this patch tested?
   
   New `HiveSessionImplSuite` tests covering both the default (rejected) and 
legacy-enabled (applied) cases.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 4.8)


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