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

    https://github.com/apache/spark/pull/21426#discussion_r190683345
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala ---
    @@ -372,8 +376,27 @@ private[spark] class SparkSubmit extends Logging {
           localJars = Option(args.jars).map {
             downloadFileList(_, targetDir, sparkConf, hadoopConf, secMgr)
           }.orNull
    -      localPyFiles = Option(args.pyFiles).map {
    -        downloadFileList(_, targetDir, sparkConf, hadoopConf, secMgr)
    +      localPyFiles = Option(args.pyFiles).map { pyFiles =>
    +        if (isClientPythonSubmit) {
    +          // In case of client with submit, the python paths should be set 
before context
    +          // initialization.
    +          // In case of shell, the context initialization is done ahead so 
we are
    +          // fine but in case of client with submit, the context 
initialization can be done later.
    +          // We will copy the local .py files because .py file shouldn't 
be added
    +          // alone but its parent directory. See SPARK-24384.
    +          localPyFilesTargetDir = Utils.createTempDir(namePrefix = 
"localPyFiles")
    +          Utils.stringToSeq(pyFiles).map { pyFile =>
    --- End diff --
    
    This logic is copied from `downloadFileList`.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to