Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce >> mail # user >> modifying existing wordcount example


Copy link to this message
-
modifying existing wordcount example
Hi,
  In the wordcount example:
http://hadoop.apache.org/docs/r0.17.0/mapred_tutorial.html
Lets say I run the above example and save the the output.
But lets say that I have now a new input file. What I want to do is..
basically again do the wordcount but basically modifying the previous
counts.
For example..
sample_input1.txt  //foo bar foo bar bar bar
After first run:
1) foo 2
2) bar 4

Save it in output1.txt

Now sample_input2.txt //bar hello world
Now the result I am looking for is:
1)foo 2
2)bar 5
3) hello 1
4) world 1

How do i achieve this in map reduce?
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB