HyukjinKwon opened a new pull request, #50017: URL: https://github.com/apache/spark/pull/50017
### What changes were proposed in this pull request? This PR proposes to match local Spark Connect server logic between Python and Scala. This PR includes: 1. Synchronize the local server and terminates it on `SparkSession.stop()` in Scala 2. Remove the internal `SPARK_LOCAL_CONNECT` environment variable and `spark.local.connect` configurations, and handle them in `SparkSubmitCommandBuilder.buildSparkSubmitArgs`, and do not send `spark.remote` and `spark.api.mode` when locally running Spark Connect server. ### Why are the changes needed? To have the consistent behaviours between Python and Scala Spark Connect. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Manually: ``` ./bin/spark-shell --master "local" --conf spark.api.mode=connect ``` ``` ./bin/spark-shell --remote "local[*]" ``` ``` ./bin/spark-shell --master "local" --conf spark.api.mode=classic ``` ``` git clone https://github.com/HyukjinKwon/spark-connect-example cd spark-connect-example build/sbt package cd .. git clone https://github.com/apache/spark.git cd spark build/sbt package sbin/start-connect-server.sh bin/spark-submit --name "testApp" --remote "sc://localhost" --class com.hyukjinkwon.SparkConnectExample ../spark-connect-example/target/scala-2.13/spark-connect-example_2.13-0.0.1.jar ``` ``` ./bin/pyspark --master "local" --conf spark.api.mode=connect ``` ``` ./bin/pyspark --remote "local" ``` ``` ./bin/pyspark --conf spark.api.mode=classic ``` ``` ./bin/pyspark --conf spark.api.mode=connect ``` There is also an existing unittest with Yarn. ### Was this patch authored or co-authored using generative AI tooling? No. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org