GitHub user jerryshao opened a pull request:
https://github.com/apache/spark/pull/17038
[SPARK-19707][Core] Improve the invalid path check for sc.addJar
## What changes were proposed in this pull request?
Currently in Spark there're two issues when we add jars with invalid path:
* If the jar path is a empty string {--jar ",dummy.jar"}, then Spark will
resolve it to the current directory path and add to classpath / file server,
which is unwanted. This is happened in our programatic way to submit Spark
application. From my understanding Spark should defensively filter out such
empty path.
* If the jar path is a invalid path (file doesn't exist), `addJar` doesn't
check it and will still add to file server, the exception will be delayed until
job running. Actually this local path could be checked beforehand, no need to
wait until task running. We have similar check in `addFile`, but lacks similar
similar mechanism in `addJar`.
## How was this patch tested?
Add unit test and local manual verification.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jerryshao/apache-spark SPARK-19707
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/17038.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #17038
----
commit db5c287e1223522de9c17391c3ea3025c938158e
Author: jerryshao <[email protected]>
Date: 2017-02-23T09:21:32Z
improve the invalid path check for sc.addJar
Change-Id: I97c3fa0b0c2c1e9584d7d3abd30e352266f116be
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]