Can we use different input and output format classes?

0 votes

Can we use different i/p and o/p format classes- (say one TextInputFormat and another KeyValueTextInputFormat ) . here -

job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);

Can we use different i/p and o/p format classes?

Jul 22 in Big Data Hadoop by Tilak
31 views

1 answer to this question.

0 votes

Yes, InputFormatClass and OutputFormatClass are independent of each other.

InputFormatClass

InputFormat defines how the input files are split up and read in Hadoop.  Initially, the data for a MapReduce task is stored in input files, and input files typically reside in HDFS. Although these files format is arbitrary, line-based log files and binary format can be used. Using InputFormat we define how these input files are split and read. 

OutputFormatClass

The Hadoop Output Format checks the Output-Specification of the job. It determines how RecordWriter implementation is used to write output to output files. As we know, Reducer takes as input a set of an intermediate key-value pair produced by the mapper and runs a reducer function on them to generate output that is again zero or more key-value pairs.  RecordWriter writes these output key-value pairs from the Reducer phase to output files. OutputFormat instances provided by Hadoop are used to write to files on the HDFS or local disk. OutputFormat describes the output-specification for a Map-Reduce job.

answered Jul 22 by Jishan

Related Questions In Big Data Hadoop

0 votes
1 answer

Can we use different i/p and o/p format classes in mapreduce code?

Yes, InputFormatClass and OutputFormatClass are independent of ...READ MORE

answered Jul 9 in Big Data Hadoop by Jimmy
34 views
0 votes
1 answer
0 votes
1 answer

Can we use apache Mahout without Hadoop dependency?

There is a number of algorithm implementations ...READ MORE

answered Apr 26, 2018 in Big Data Hadoop by nitinrawat895
• 10,760 points
75 views
0 votes
1 answer

Can we use HDFS to store git repositories?

Yes, it is possible to use HDFS ...READ MORE

answered May 7, 2018 in Big Data Hadoop by nitinrawat895
• 10,760 points
184 views
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,760 points
3,549 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,760 points
440 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
18,165 views
0 votes
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,280 points
1,317 views
0 votes
3 answers

Can we run Spark without using Hadoop?

No, you can run spark without hadoop. ...READ MORE

answered May 7 in Big Data Hadoop by pradeep
224 views
0 votes
1 answer

Why we need to install "ant -Dhadoopversion=23" ? What is the use of this?

Hi, We install ant to build pig, If the ...READ MORE

answered Apr 26 in Big Data Hadoop by Gitika
• 25,420 points
48 views