You have just run a MapReduce job to filter user messages to only those of a selected
geographical region. The output for this job is in a directory named westUsers, located just below
your home directory in HDFS. Which command gathers these into a single file on your local file
system?
A.
Hadoop fs –getmerge –R westUsers.txt
B.
Hadoop fs –getemerge westUsers westUsers.txt
C.
Hadoop fs –cp westUsers/* westUsers.txt
D.
Hadoop fs –get westUsers westUsers.txt
B is the correct answer and one more command you can try i.e
hadoop fs -cat /user/*.txt | hadoop fs -put – /user/abc
which will merge all files with .txt extension under user directory to a new file abc under the same user directory.
0
0
B is the only one to be correct but there is a mistake
should be “hadoop fs –getmerge westUsers westUsers.txt” instead “Hadoop fs –getEmerge westUsers westUsers.txt”
http://hadoop.apache.org/docs/r2.7.0/hadoop-project-dist/hadoop-common/FileSystemShell.html#getmerge
0
0
-getmerge option to the hadoop fs command
gets all the files in the directory specified in the source pattern and
merges them into a single file on the local filesystem
0
0
B is correct.
0
0
B
0
0