Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19102#discussion_r136626161
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala ---
    @@ -496,7 +496,7 @@ object SparkSubmit extends CommandLineUtils with 
Logging {
             sysProp = "spark.executor.memory"),
           OptionAssigner(args.totalExecutorCores, STANDALONE | MESOS, 
ALL_DEPLOY_MODES,
             sysProp = "spark.cores.max"),
    -      OptionAssigner(args.files, LOCAL | STANDALONE | MESOS, 
ALL_DEPLOY_MODES,
    +      OptionAssigner(args.files, ALL_CLUSTER_MGRS, ALL_DEPLOY_MODES,
    --- End diff --
    
    I think @jerryshao mentioned this in your other PR, but this is not 
correct. YARN distributes these files through other means, so doing this might 
cause other issues.
    
    What you want to do here to make the files show up in the driver is to add 
some code in `SparkContext`. There's this code at the end of `def addFile`, 
which was added in SPARK-16787:
    
    ```
        val timestamp = System.currentTimeMillis
        if (addedFiles.putIfAbsent(key, timestamp).isEmpty) {
          logInfo(s"Added file $path at $key with timestamp $timestamp")
          // Fetch the file locally so that closures which are run on the 
driver can still use the
          // SparkFiles API to access files.
          Utils.fetchFile(uri.toString, new 
File(SparkFiles.getRootDirectory()), conf,
            env.securityManager, hadoopConfiguration, timestamp, useCache = 
false)
          postEnvironmentUpdate()
        }
    ```
    
    You basically want to do that for all files in `spark.yarn.dist.files` when 
in YARN client mode.


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

Reply via email to