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

    https://github.com/apache/spark/pull/12752#discussion_r61457451
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/dstream/FileInputDStream.scala
 ---
    @@ -195,10 +195,13 @@ class FileInputDStream[K, V, F <: NewInputFormat[K, 
V]](
           )
           logDebug(s"Getting new files for time $currentTime, " +
             s"ignoring files older than $modTimeIgnoreThreshold")
    -      val filter = new PathFilter {
    +      val newFileFilter = new PathFilter {
             def accept(path: Path): Boolean = isNewFile(path, currentTime, 
modTimeIgnoreThreshold)
           }
    -      val newFiles = fs.listStatus(directoryPath, 
filter).map(_.getPath.toString)
    +      val directories = fs.globStatus(directoryPath, 
directoryFilter).map(_.getPath)
    --- End diff --
    
    No. `fs.globStatus` Return all the files that match filePattern and it will 
not dive into the nested folder.
    
    Say folder structure looks like following
    /root
    ..../Jack
    ......../subDir1
    ......../JackFile1
    ..../Rose
    ......../subDir1
    ......../subDir2
    ......../RoseFile1
    ..../file1
    
    Case 1:  `/root/Jack/subDir1` it will monitor any new files added into 
exact "/root/Jack/subDir1" if "JackFile1" is a new added file, it's NOT in 
scope.
    Case 2: `/root/Jack` it will monitor any new files added into "/root/Jack" 
folder. New files added into "/root/Jack/subDir1" is NOT in scope.
    Case 3: `/root/*/subDir1` it will minitor any new files added into both 
"/root/Jack/subDir1" and "/root/Rose/subDir1".
    Case 4: `/root/Rose/*` it will monitor any new files added into 
"/root/Rose/subDir1" and "/root/Rose/subDir2".


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