HyukjinKwon commented on a change in pull request #31565:
URL: https://github.com/apache/spark/pull/31565#discussion_r576536530



##########
File path: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
##########
@@ -1072,14 +1072,29 @@ object SparkSubmit extends CommandLineUtils with 
Logging {
    * Return whether the given primary resource requires running python.
    */
   private[deploy] def isPython(res: String): Boolean = {
-    res != null && res.endsWith(".py") || res == PYSPARK_SHELL
+    if (res == null) {
+      return false
+    }
+    if (res == PYSPARK_SHELL) {
+      return true
+    }
+    val uri = new java.net.URI(res)

Review comment:
       I think the problem here is that it wouldn't work with local paths that 
has special characters disallowed in URI. See `PythonRunner` or `RRunner`.
   
   Can we just do something like `Try(new 
java.net.URI(res).getPath).getOrElse(res).endsWith(".py")`? We will also have 
to have a test case.




----------------------------------------------------------------
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:
[email protected]



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

Reply via email to