Hadoop Questions and Answers – Hadoop Streaming

This set of Hadoop Multiple Choice Questions & Answers (MCQs) focuses on “Hadoop Streaming”.

1. Streaming supports streaming command options as well as _________ command options.
a) generic
b) tool
c) library
d) task
View Answer

Answer: a
Explanation: Place the generic options before the streaming options, otherwise the command will fail.

2. Point out the correct statement.
a) You can specify any executable as the mapper and/or the reducer
b) You cannot supply a Java class as the mapper and/or the reducer
c) The class you supply for the output format should return key/value pairs of Text class
d) All of the mentioned
View Answer

Answer: a
Explanation: If you do not specify an input format class, the TextInputFormat is used as the default.

3. Which of the following Hadoop streaming command option parameter is required?
a) output directoryname
b) mapper executable
c) input directoryname
d) all of the mentioned
View Answer

Answer: d
Explanation: Required parameters are used for Input and Output location for the mapper.

advertisement
advertisement

4. To set an environment variable in a streaming command use ____________
a) -cmden EXAMPLE_DIR=/home/example/dictionaries/
b) -cmdev EXAMPLE_DIR=/home/example/dictionaries/
c) -cmdenv EXAMPLE_DIR=/home/example/dictionaries/
d) -cmenv EXAMPLE_DIR=/home/example/dictionaries/
View Answer

Answer: c
Explanation: Environment Variable is set using cmdenv command.

5. Point out the wrong statement.
a) Hadoop has a library package called Aggregate
b) Aggregate allows you to define a mapper plugin class that is expected to generate “aggregatable items” for each input key/value pair of the mappers
c) To use Aggregate, simply specify “-mapper aggregate”
d) None of the mentioned
View Answer

Answer: c
Explanation: To use Aggregate, simply specify “-reducer aggregate”:

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. The ________ option allows you to copy jars locally to the current working directory of tasks and automatically unjar the files.
a) archives
b) files
c) task
d) none of the mentioned
View Answer

Answer: a
Explanation: Archives options is also a generic option.

7. ______________ class allows the Map/Reduce framework to partition the map outputs based on certain key fields, not the whole keys.
a) KeyFieldPartitioner
b) KeyFieldBasedPartitioner
c) KeyFieldBased
d) None of the mentioned
View Answer

Answer: b
Explanation: The primary key is used for partitioning, and the combination of the primary and secondary keys is used for sorting.

advertisement

8. Which of the following class provides a subset of features provided by the Unix/GNU Sort?
a) KeyFieldBased
b) KeyFieldComparator
c) KeyFieldBasedComparator
d) All of the mentioned
View Answer

Answer: c
Explanation: Hadoop has a library class, KeyFieldBasedComparator, that is useful for many applications.

9. Which of the following class is provided by the Aggregate package?
a) Map
b) Reducer
c) Reduce
d) None of the mentioned
View Answer

Answer: b
Explanation: Aggregate provides a special reducer class and a special combiner class, and a list of simple aggregators that perform aggregations such as “sum”, “max”, “min” and so on over a sequence of values.

advertisement

10. Hadoop has a library class, org.apache.hadoop.mapred.lib.FieldSelectionMapReduce, that effectively allows you to process text data like the unix ______ utility.
a) Copy
b) Cut
c) Paste
d) Move
View Answer

Answer: b
Explanation: The map function defined in the class treats each input key/value pair as a list of fields.

Sanfoundry Global Education & Learning Series – Hadoop.

Here’s the list of Best Books in Hadoop.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.