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

    https://github.com/apache/spark/pull/2765#discussion_r31429608
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/dstream/FileInputDStream.scala
 ---
    @@ -223,6 +266,11 @@ class FileInputDStream[K, V, F <: NewInputFormat[K,V]](
        */
       private def isNewFile(path: Path, currentTime: Long, 
modTimeIgnoreThreshold: Long): Boolean = {
         val pathStr = path.toString
    +    // Reject file if it start with _
    +    if (path.getName().startsWith("_")) {
    --- End diff --
    
    Could you add this filter to `FileInputDStream.defaultFilter`? 
    
    @tdas is it a bug that `FileInputDStream.defaultFilter` only ignores files 
that start with `.`? Hadoop uses the following path filter 
(FileInputFormat.hiddenFileFilter):
    ```Java
        private static final PathFilter hiddenFileFilter = new PathFilter() {
            public boolean accept(Path p) {
                String name = p.getName();
                return !name.startsWith("_") && !name.startsWith(".");
            }
        };
    ```
    Since SparkContext.textFile uses `TextInputFormat`, it uses this filter and 
ignores files that start with "-" or ".". Should Streaming be consistent with 
Core?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to