Declaring separator in the MapReduce(Hadoop 0.20)

0 votes

My input is like

One, Microsoft
Two, Google
Three, Facebook

And the output should be in the form of :

Key : One
Value : Microsoft
Key : Two
Value : Google

The am using KeyValueTextInputFormat:

    Job job1 = new Job(conf, "MyJob");
    job1.setInputFormatClass(KeyValueTextInputFormat.class);
    KeyValueTextInputFormat.addInputPath(job1, new Path("/user/abc.txt"));

If the delimiter is tab, this works fine. Can help me with the new API and tell me how to do I specify the separator as ‘,’.

Apr 20, 2018 in Big Data Hadoop by Shubham
• 13,300 points
28 views

1 answer to this question.

0 votes

In the new API you have to specify the value of  mapreduce.input.keyvaluelinerecordreader.key.value.separator  property as ‘,’.

conf.set("mapreduce.input.keyvaluelinerecordreader.key.value.separator", ",");
answered Apr 20, 2018 by kurt_cobain
• 9,260 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to format the output being written by MapReduce in Hadoop?

Here is a simple code demonstrate the ...READ MORE

answered Sep 5, 2018 in Big Data Hadoop by Frankie
• 9,810 points
136 views
0 votes
1 answer

What is the difference between Hadoop MapReduce and built-in MapReduce?

Differences are as follows: Hadoop's MR can be ...READ MORE

answered Sep 11, 2018 in Big Data Hadoop by Frankie
• 9,810 points
216 views
0 votes
3 answers

How to specify KeyValueTextInputFormat Separator in Hadoop-.20 api?

conf.set("key.value.separator.in.input.line", ","); Job job = new J ...READ MORE

answered Dec 4, 2018 in Big Data Hadoop by Rio
213 views
0 votes
1 answer

In Hadoop MapReduce, how can i set an Object as the Value for Map output?

Try this and see if it works: public ...READ MORE

answered Nov 20, 2018 in Big Data Hadoop by Omkar
• 67,660 points
39 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,710 points
3,295 views
0 votes
10 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
16,213 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,260 points
1,182 views
0 votes
1 answer
0 votes
1 answer