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


##########
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:
   A spark master URL is not compatible with a connect URL... How is this 
supposed to work. More generally, why should the client have to deal with spark 
master URLs, at this point in time you should be able to pass a valid remote 
URL.



##########
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:
   A spark master URL is not compatible with a connect URL... How is this 
supposed to work? More generally, why should the client have to deal with spark 
master URLs, at this point in time you should be able to pass a valid remote 
URL.



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