hvanhovell commented on code in PR #47434:
URL: https://github.com/apache/spark/pull/47434#discussion_r1689027244
##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -890,7 +891,49 @@ object SparkSession extends Logging {
// the remote() function, as it takes precedence over the SPARK_REMOTE
environment variable.
private val builder = SparkConnectClient.builder().loadFromEnvironment()
private var client: SparkConnectClient = _
- private[this] val options = new scala.collection.mutable.HashMap[String,
String]
+ private var server: Option[Process] = None
+ private[this] lazy val options = {
+ val configs: Map[String, String] =
+ sys.props.filter(p => p._1.startsWith("spark.sql.") &&
p._2.nonEmpty).toMap
+ val map = new scala.collection.mutable.HashMap[String, String]
+ map.addAll(configs)
+ }
+ private def remoteString: Option[String] = {
+ options
+ .get("spark.remote")
+ .orElse(Option(System.getProperty("spark.remote"))) // Set from Spark
Submit
+ .orElse(sys.env.get(SparkConnectClient.SPARK_REMOTE))
+ }
+
+ private def withLocalConnectServer[T](f: => T): T = {
Review Comment:
Is this normal? I though the submit would take care of this for us?
--
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]