07ARB commented on a change in pull request #26773: 
[SPARK-30126][CORE]sparkContext.addFile fails when file path contains…
URL: https://github.com/apache/spark/pull/26773#discussion_r354725852
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/SparkContext.scala
 ##########
 @@ -1538,7 +1538,7 @@ class SparkContext(config: SparkConf) extends Logging {
     val scheme = new URI(schemeCorrectedPath).getScheme
     if (!Array("http", "https", "ftp").contains(scheme)) {
       val fs = hadoopPath.getFileSystem(hadoopConfiguration)
-      val isDir = fs.getFileStatus(hadoopPath).isDirectory
+      val isDir = fs.getFileStatus(new Path(path)).isDirectory
 
 Review comment:
   in return statement of java.io.File#exists : 
   (fs.getBooleanAttributes(this)  = 0 (if path = 
file:/Users/ankitrajboudh/test%20dir/ankit.conf)
   (fs.getBooleanAttributes(this)  != 0 (file:/Users/ankitrajboudh/test 
dir/ankit.conf)
   
   java.io.File#exists - Please check this exists method return statement- 
   public boolean exists() {
           SecurityManager security = System.getSecurityManager();
           if (security != null) {
               security.checkRead(path);
           }
           if (isInvalid()) {
               return false;
           }
           return ((fs.getBooleanAttributes(this) & FileSystem.BA_EXISTS) != 0);
       }

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


With regards,
Apache Git Services

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

Reply via email to