Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/799#discussion_r12765889
--- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala ---
@@ -303,14 +309,36 @@ object SparkSubmit {
}
/**
+ * Return whether the given primary resource represents a user jar.
+ */
+ private def isUserJar(primaryResource: String): Boolean = {
+ !isShell(primaryResource) && !isPython(primaryResource)
+ }
+
+ /**
+ * Return whether the given primary resource represents a shell.
+ */
+ private def isShell(primaryResource: String): Boolean = {
+ primaryResource == SPARK_SHELL || primaryResource == PYSPARK_SHELL
+ }
+
+ /**
+ * Return whether the given primary resource requires running python.
+ */
+ private[spark] def isPython(primaryResource: String): Boolean = {
+ primaryResource.endsWith(".py") || primaryResource == PYSPARK_SHELL
+ }
+
+ /**
* Merge a sequence of comma-separated file lists, some of which may be
null to indicate
* no files, into a single comma-separated string.
*/
private[spark] def mergeFileLists(lists: String*): String = {
- val merged = lists.filter(_ != null)
- .flatMap(_.split(","))
- .mkString(",")
- if (merged == "") null else merged
+ lists
+ .filter(_ != null)
+ .filter(_ != "")
+ .flatMap(_.split(","))
+ .mkString(",")
--- End diff --
This will now set files to the empty string instead of null even if there
are no files present. To be conservative, would it make sense to change it
back? I think there are null checks on this downstream when the option assinger
is used. Could this change the behavior in some cases, e.g. by settting
`spark.files` sys prop even when there are no files present.
---
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.
---