pyspark.SparkFiles.getRootDirectory

classmethod SparkFiles.getRootDirectory() → str[source]

Get the root directory that contains files added through SparkContext.addFile() or SparkContext.addPyFile().

New in version 0.7.0.

Returns
str

the root directory that contains files added to resources

Examples

>>> from pyspark.files import SparkFiles
>>> SparkFiles.getRootDirectory()  
'.../spark-a904728e-08d3-400c-a872-cfd82fd6dcd2/userFiles-648cf6d6-bb2c-4f53-82bd-e658aba0c5de'