Hi Srilathar, I know this thread is quite old but I need your help with this.
I'm interested in also making some modifications to the hadoop Sort example. Please could you give me pointers on how to rebuild hadoop to reflect the changes made in the source. I'm new to hadoop and would really appreciate your assistance. us latha wrote: > > Greetings! > > Hi, Am trying to modify the WordCount.java mentioned at Example: WordCount > v1.0<http://hadoop.apache.org/core/docs/current/mapred_tutorial.html#Example%3A+WordCount+v1.0>at > http://hadoop.apache.org/core/docs/current/mapred_tutorial.html > Would like to have output the following way, > > FileOne word1 itsCount > FileOne word2 itsCount > ..(and so on) > FileTwo word1 itsCount > FileTwo wordx its Count > .. > FileThree word1 its Count > .. > > Am trying to do following changes to the code of WordCount.java > > 1) private Text filename = new Text(); // Added this to Map class .Not > sure if I would have access to filename here. > 2) (line 18)OutputCollector<Text, Text, IntWritable> output // Changed > the > argument in the map() function to have another Text field. > 3) (line 23) output.collect(filename, word , one); // Trying to change > the > output format as 'filename word count' > > Am not sure what other changes are to be affected to achieve the required > output. filename is not available to the map method. > My requirement is to go through all the data available in hdfs and prepare > an index file with < filename word count> format. > Could you please throw light on how I can achieve this. > > Thankyou > Srilatha > > -- View this message in context: http://old.nabble.com/How-to-modify-hadoop-wordcount-example-to-display-File-wise-results.-tp19826857p33410747.html Sent from the Hadoop core-user mailing list archive at Nabble.com.
