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,490 points
389 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,390 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,830 points
2,238 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,830 points
1,176 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 ...READ MORE

answered Dec 5, 2018 in Big Data Hadoop by Rio
1,503 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 21, 2018 in Big Data Hadoop by Omkar
• 69,210 points
745 views
+1 vote
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
• 11,380 points
10,521 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
103,811 views
–1 vote
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,390 points
4,234 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP