zhengruifeng commented on code in PR #48781:
URL: https://github.com/apache/spark/pull/48781#discussion_r1831765993


##########
python/pyspark/core/context.py:
##########
@@ -554,6 +554,28 @@ def setSystemProperty(cls, key: str, value: str) -> None:
         assert SparkContext._jvm is not None
         SparkContext._jvm.java.lang.System.setProperty(key, value)
 
+    @classmethod
+    def getSystemProperty(cls, key: str) -> str:
+        """
+        Get a Java system property, such as `java.home`.
+
+        .. versionadded:: 4.0.0
+
+        Parameters
+        ----------
+        key : str
+            The key of a new Java system property.
+
+        Examples
+        --------
+        >>> sc.getSystemProperty("SPARK_SUBMIT")
+        'true'
+        >>> _ = sc.getSystemProperty("java.home")
+        """
+        SparkContext._ensure_initialized()
+        assert SparkContext._jvm is not None
+        return SparkContext._jvm.java.lang.System.getProperty(key)

Review Comment:
   three questions:
   1, shall we name it to be more specific to the Java?
   2, do we need to also introduce it in Scala side?
   3, shall we make it a SparkSession method? so that we can enable it in 
SparkConnect later
   
   also cc @cloud-fan for this new feature.



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