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

    https://github.com/apache/spark/pull/18962#discussion_r133609050
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala ---
    @@ -330,18 +330,45 @@ object SparkSubmit extends CommandLineUtils {
         args.archives = Option(args.archives).map(resolveGlobPaths(_, 
hadoopConf)).orNull
     
         // In client mode, download remote files.
    +    var localPrimaryResource: String = null
    +    var localJars: String = null
    +    var localPyFiles: String = null
         if (deployMode == CLIENT) {
    -      args.primaryResource = Option(args.primaryResource).map {
    +      localPrimaryResource = Option(args.primaryResource).map {
             downloadFile(_, targetDir, args.sparkProperties, hadoopConf)
           }.orNull
    -      args.jars = Option(args.jars).map {
    +      localJars = Option(args.jars).map {
             downloadFileList(_, targetDir, args.sparkProperties, hadoopConf)
           }.orNull
    -      args.pyFiles = Option(args.pyFiles).map {
    +      localPyFiles = Option(args.pyFiles).map {
             downloadFileList(_, targetDir, args.sparkProperties, hadoopConf)
           }.orNull
         }
     
    +    if (clusterManager == YARN) {
    +      def isNoneFsFileExist(paths: String): Boolean = {
    +        Option(paths).exists { p =>
    +          p.split(",").map(_.trim).filter(_.nonEmpty).exists { path =>
    +            val url = Utils.resolveURI(path)
    +            url.getScheme match {
    +              case "http" | "https" | "ftp" => true
    +              case _ => false
    +            }
    +          }
    +        }
    +      }
    +
    +      // Spark on YARN doesn't support upload remote resources from http, 
https or ftp server
    +      // directly to distributed cache, so print a warning and exit the 
process.
    +      if (isNoneFsFileExist(args.jars) ||
    --- End diff --
    
    The code 
[here](https://github.com/apache/spark/blob/b8ffb51055108fd606b86f034747006962cd2df3/resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala#L346)
 compare two FSs and copy src to dest if FS is different. AFAIK there's no http 
scheme in Hadoop, so `val srcFs = srcPath.getFileSystem(hadoopConf)` this 
probably will throw exception.


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