pan3793 commented on code in PR #41201:
URL: https://github.com/apache/spark/pull/41201#discussion_r1196873001


##########
core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala:
##########
@@ -425,7 +428,7 @@ private[spark] class SparkSubmit extends Logging {
             case (localResources, resolvedUri) =>
               val source = new File(localResources.getPath)
               val dest = new File(
-                ".",
+                workingDirectory,
                 if (resolvedUri.getFragment != null) resolvedUri.getFragment 
else source.getName)

Review Comment:
   Since `.` is participated in, can we call `File#getCanonicalFile` before 
assigning `source` and `dest` here to improve the following log format?
   
   ```log
   Files  ... from 
/tmp/spark-1a68de84-0fb2-4cf6-8f7a-302c24509935/xyz-plugin-spark3-2.12-20230516-131757.jar.jar
 to /opt/spark/work-dir/./xyz-plugin-spark3-2.12-20230516-131757.jar
   ```
   
   And the logging statement can be simplified to
   
   ```patch
   -logInfo(
   -  s"Files  $resolvedUri " +
   -    s"from ${source.getAbsolutePath} to ${dest.getAbsolutePath}")
   +logInfo(s"Files $resolvedUri from $source to $dest")
   ```



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

To unsubscribe, e-mail: [email protected]

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