I\'m trying to get the path to spark.worker.dir
for the current sparkcontext
.
If I explicitly set it as a config param
, I can read
Unfortunately, no, the Spark platform as of version 2.3.1 does not provide any way to programmatically access the value of every property at run time. It provides several methods to access the values of properties that were explicitly set through a configuration file (like spark-defaults.conf
), set through the SparkConf
object when you created the session, or set through the command line when you submitted the job, but none of these methods will show the default value for a property that was not explicitly set. For completeness, the best options are:
http://:4040
, has an “Environment” tab with a property value table.SparkContext
keeps a hidden reference to its configuration in PySpark, and the configuration provides a getAll
method: spark.sparkContext._conf.getAll()
.spark.sql("SET").toPandas()
. You can also use SET -v
to include a column with the property’s description.(These three methods all return the same data on my cluster.)