This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new ee15beb6ed54 [SPARK-53808][CONNECT] Allow to pass optional JVM args to
`spark-connect-scala-client`
ee15beb6ed54 is described below
commit ee15beb6ed54171c0fd34222091102a6cc25992c
Author: Kousuke Saruta <[email protected]>
AuthorDate: Tue Oct 7 21:22:09 2025 -0700
[SPARK-53808][CONNECT] Allow to pass optional JVM args to
`spark-connect-scala-client`
### What changes were proposed in this pull request?
This PR proposes an improvement to allow to pass optionaj JVM args to
`spark-connect-scala-client` through an environment variable `SCJVM_ARGS`.
### Why are the changes needed?
Different from other REPL tools like `spark-shell`,
`spark-connect-scala-client` doesn't support optional JVM args.
`--driver-java-options` doesn't affect client side.
### Does this PR introduce _any_ user-facing change?
Yes but doesn't break compatibility.
### How was this patch tested?
To use debugger, set
`-agentlib:jdwp=transport=dt_socket,suspend=n,server=y,address=9876` to
`SCJVM_ARGS`, and I confirmed it worked.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #52526 from sarutak/connect-scala-jvm-option.
Authored-by: Kousuke Saruta <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
sql/connect/bin/spark-connect-scala-client | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sql/connect/bin/spark-connect-scala-client
b/sql/connect/bin/spark-connect-scala-client
index 31fe0217c6e7..4d508e626df7 100755
--- a/sql/connect/bin/spark-connect-scala-client
+++ b/sql/connect/bin/spark-connect-scala-client
@@ -31,6 +31,7 @@
#
# Set SCBUILD=0 to skip rebuilding the spark-connect server.
# Set SCCLASSPATH to the client classpath to skip resolving it with sbt.
+# Set SCJVM_ARGS to optional JVM args for the client.
# Go to the Spark project root directory
FWDIR="$(cd "`dirname "$0"`"/../../..; pwd)"
@@ -70,6 +71,7 @@ JVM_ARGS="-XX:+IgnoreUnrecognizedVMOptions \
--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED \
-Djdk.reflect.useDirectMethodHandle=false \
-Dio.netty.tryReflectionSetAccessible=true \
- --enable-native-access=ALL-UNNAMED"
+ --enable-native-access=ALL-UNNAMED \
+ $SCJVM_ARGS"
exec java $JVM_ARGS -cp "$SCCLASSPATH"
org.apache.spark.sql.application.ConnectRepl "$@"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]