PrepAway - Latest Free Exam Questions & Answers

How many files will be processed by the FileInputFormat.setInputPaths () command when it’s given a path

You have a directory named jobdata in HDFS that contains four files: _first.txt, second.txt, .third.txt
and #data.txt. How many files will be processed by the FileInputFormat.setInputPaths () command
when it’s given a path object representing this directory?

PrepAway - Latest Free Exam Questions & Answers

A.
Four, all files will be processed

B.
Three, the pound sign is an invalid character for HDFS file names

C.
Two, file names with a leading period or underscore are ignored

D.
None, the directory cannot be named jobdata

E.
One, no special characters can prefix the name of an input file

Explanation:
Files starting with ‘_’ are considered ‘hidden’ like unix files starting with ‘.’.
# characters are allowed in HDFS file names.

2 Comments on “How many files will be processed by the FileInputFormat.setInputPaths () command when it’s given a path

  1. Henry says:

    C. The FileInputFormat filters out hidden files.

    private static final PathFilter hiddenFileFilter = new PathFilter(){
    public boolean accept(Path p){
    String name = p.getName();
    return !name.startsWith(“_”) && !name.startsWith(“.”);
    }
    };




    0



    0

Leave a Reply

Your email address will not be published. Required fields are marked *