wilmerdooley opened a new pull request, #56623:
URL: https://github.com/apache/spark/pull/56623

   When running in local mode with a non-default job artifact UUID, 
`SparkFiles.get` resolved filenames against the per-session artifact directory, 
while files added via `SparkContext.addFile` were placed directly under the 
root directory. This made such files inaccessible from SQL-planned operations 
even though they were visible to code that ran outside a SQL session. The 
change falls back to the root directory when the job-specific path does not 
exist in local mode, mirroring the same behavior on the Scala, JVM Python 
worker, and PySpark Python sides.
   
   ### Changes
   - `core/src/main/scala/org/apache/spark/SparkFiles.scala`: in `get`, if the 
job-specific path does not exist and the master is local, fall back to the file 
directly under `getRootDirectory()`.
   - `core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala`: 
export `SPARK_LOCAL_MODE` to Python workers so they can apply the same fallback.
   - `python/pyspark/core/files.py`: in `SparkFiles.get`, when running on a 
worker, the file is missing under the current root, the master is local, and 
the job artifact UUID is non-default, fall back to the file under the parent of 
the current root directory.
   - 
`sql/core/src/test/scala/org/apache/spark/sql/artifact/ArtifactManagerSuite.scala`
 and `python/pyspark/sql/tests/test_artifact.py`: add regression tests that add 
a file via `SparkContext.addFile` and read it through `SparkFiles.get` from a 
SQL-planned operation.
   
   JIRA: https://issues.apache.org/jira/browse/SPARK-53478


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