HyukjinKwon commented on code in PR #48930:
URL: https://github.com/apache/spark/pull/48930#discussion_r1870519689


##########
sql/connect/common/src/main/scala/org/apache/spark/sql/connect/client/SparkConnectClient.scala:
##########
@@ -620,8 +620,17 @@ object SparkConnectClient {
      * Configure the builder using the env SPARK_REMOTE environment variable.
      */
     def loadFromEnvironment(): Builder = {
+      lazy val isAPIModeConnect = Option(System.getProperty("spark.api.mode"))
+        .exists(_.toLowerCase(Locale.ROOT) == "connect")
       Option(System.getProperty("spark.remote")) // Set from Spark Submit
         .orElse(sys.env.get(SparkConnectClient.SPARK_REMOTE))
+        .orElse {
+          if (isAPIModeConnect) {
+            
Option(System.getProperty("spark.master")).orElse(sys.env.get("MASTER"))

Review Comment:
   Actually for now, we need this because we directly start ConnectRepl for 
Spark Connect shell. Once we have a layer for Spark Connect (e.g., at 
https://github.com/apache/spark/pull/49053), we would be able to separate it 
out.



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