There are three filter modes available for ListHDFS that determine how the regular expression in the File Filter property will be applied to listings in HDFS.
Directories and FilesRecurse Subdirectories is set to true, only subdirectories with a matching name will be searched for files that match the regular expression defined in File Filter.
Files OnlyRecurse Subdirectories is set to true, the entire subdirectory tree will be searched for files that match the regular expression defined in File Filter.
Full PathRecurse Subdirectories is set to true, the entire subdirectory tree will be searched for files in which the full path of the file matches the regular expression defined in File Filter.scheme and authority, if a given file has a full path of hdfs://hdfscluster:8020/data/txt/1.txt, the filter will evaluate the regular expression defined in File Filter against two cases, matching if either is true:hdfs), authority (hdfscluster:8020), and the remaining path components (/data/txt/1.txt)/data/txt/1.txt)
File Filter. When Recurse Subdirectories is true, this mode allows the user to filter for files in subdirectories with names that match the regular expression defined in File Filter.
Property | Value |
|---|---|
Directory | /data |
Recurse Subdirectories | true |
File Filter | .*txt.* |
Filter Mode | Directories and Files |
ListHDFS results:
File Filter. Directory names will not be matched against the regular expression defined in File Filter. When Recurse Subdirectories is true, this mode allows the user to filter for files in the entire subdirectory tree of the directory specified in the Directory property.
Property | Value |
|---|---|
Directory | /data |
Recurse Subdirectories | true |
File Filter | [^\.].*\.txt |
Filter Mode | Files Only |
ListHDFS results:
File Filter. When Recurse Subdirectories is true, this mode allows the user to filter for files in the entire subdirectory tree of the directory specified in the Directory property while allowing filtering based on the full path of each file.
Property | Value |
|---|---|
Directory | /data |
Recurse Subdirectories | true |
File Filter | (/.*/)*csv/.* |
Filter Mode | Full Path |
ListHDFS results: