You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/16 18:53:13 UTC

[GitHub] [spark] vanzin commented on a change in pull request #25910: [SPARK-28762][CORE] Read JAR main class if JAR is not located in local file system

vanzin commented on a change in pull request #25910: [SPARK-28762][CORE] Read JAR main class if JAR is not located in local file system
URL: https://github.com/apache/spark/pull/25910#discussion_r335650440
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
 ##########
 @@ -437,6 +484,22 @@ private[spark] class SparkSubmit extends Logging {
       }.orNull
     }
 
+    // At this point, we have attempted to download all remote resources.
+    // Now we try to resolve the main class if our primary resource is a JAR.
+    // First, try the localPrimaryResource.
+    if (args.mainClass == null) {
+      args.mainClass = resolveMainClassIfNeeded(args, hadoopConf, localPrimaryResource)
+    }
+    // If we can't get it from localPrimaryResource, use whatever the original argument was.
 
 Review comment:
   In what case is `localPrimaryResource` not a local copy of `args.primaryResource`?
   
   If seems to me that what you want is:
   
   ```
   if (mainClass == null && not python && not R) {
     mainClass = readMainClass(Option(localPrimaryResource).getOrElse(args.primaryResource), hadoopConf)
     if (mainClass == null) yellAtUser()
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org