CCA-410 · Question #51
What occurs when you run a hadoop job specifying output directory for job output which already exists in HDFS?
The correct answer is D. An error will occur immediately because the output directory must not already exist. Class org.apache.hadoop.mapred include: Interface OutputFormat<K,V> OutputFormat describes the output-specification for a Map-Reduce job. The Map-Reduce framework relies on the OutputFormat of the job to: / Validate the output-specification of the job. For e.g. check that the…
Question
What occurs when you run a hadoop job specifying output directory for job output which already exists in HDFS?
Options
- Aan error will occur after the mappers have completed but before any reducers begin to run because the
- Bthe job will run successfully. Output from the reducers will override the contents of existing directory
- Cthe job will run successfully output from the reducers will be placed in a directory called job output -1
- DAn error will occur immediately because the output directory must not already exist.
How the community answered
(20 responses)- A10% (2)
- C5% (1)
- D85% (17)
Explanation
Class org.apache.hadoop.mapred include: * Interface OutputFormat<K,V> OutputFormat describes the output-specification for a Map-Reduce job. The Map-Reduce framework relies on the OutputFormat of the job to: / Validate the output-specification of the job. For e.g. check that the output directory doesn't / Provide the RecordWriter implementation to be used to write out the output files of the job. Output files are stored in a FileSystem. * checkOutputSpecs void checkOutputSpecs(FileSystem ignored, throws IOException Check for validity of the output-specification for the job. This is to validate the output specification for the job when it is a job is submitted. Typically checks that it does not already exist, throwing an exception when it already exists, so that output is not overwritten. job - job configuration. IOException - when output should not be attempted
Topics
Community Discussion
No community discussion yet for this question.