Skip to content

Commit ee15beb

Browse files
sarutakdongjoon-hyun
authored andcommitted
[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]>
1 parent 032a4e7 commit ee15beb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sql/connect/bin/spark-connect-scala-client

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#
3232
# Set SCBUILD=0 to skip rebuilding the spark-connect server.
3333
# Set SCCLASSPATH to the client classpath to skip resolving it with sbt.
34+
# Set SCJVM_ARGS to optional JVM args for the client.
3435

3536
# Go to the Spark project root directory
3637
FWDIR="$(cd "`dirname "$0"`"/../../..; pwd)"
@@ -70,6 +71,7 @@ JVM_ARGS="-XX:+IgnoreUnrecognizedVMOptions \
7071
--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED \
7172
-Djdk.reflect.useDirectMethodHandle=false \
7273
-Dio.netty.tryReflectionSetAccessible=true \
73-
--enable-native-access=ALL-UNNAMED"
74+
--enable-native-access=ALL-UNNAMED \
75+
$SCJVM_ARGS"
7476

7577
exec java $JVM_ARGS -cp "$SCCLASSPATH" org.apache.spark.sql.application.ConnectRepl "$@"

0 commit comments

Comments
 (0)