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


##########
python/pyspark/sql/session.py:
##########
@@ -598,11 +601,24 @@ def create(self) -> "SparkSession":
                 os.environ["SPARK_CONNECT_MODE_ENABLED"] = "1"
                 opts["spark.remote"] = url
                 return cast(SparkSession, 
RemoteSparkSession.builder.config(map=opts).create())
+            # Classic mode
             else:
-                raise PySparkRuntimeError(
-                    errorClass="ONLY_SUPPORTED_WITH_SPARK_CONNECT",
-                    messageParameters={"feature": 
"SparkSession.builder.create"},
-                )
+                with self._lock:
+                    # Build SparkConf from options
+                    sparkConf = SparkConf()
+                    for key, value in self._options.items():
+                        sparkConf.set(key, str(value))
+
+                    sc = (
+                        self._sc
+                        if getattr(self, "_sc", None) is not None and 
self._sc._jsc is not None

Review Comment:
   It's set here:
   
   
https://github.com/apache/spark/blob/70a3ab5daa4831935748867239549900815c9651/python/pyspark/sql/session.py#L616-L622
   
   in the constructor of `SparkSession`.



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