The map java function The reduce function The MapReduce function Example of the
ID: 3736812 • Letter: T
Question
The map java functionThe reduce function The MapReduce function
Example of the result
The poems data is a total of six poems found https://100.best-poems.net
Change the code to count how many words of different lengths are in the poems data. Note that for this problem, the map function should output a pair with the format and with examples or , or similar. The reduce function should stay the same because it will only count the different lengths. .To get the length of a string "theWord" in Java you need to use the function theWord.length(). For more information, visit: http://docs.oracle.com/javase/1.5.0/ docs/api/javalang/String.html Submit your code in txt and results as a screenshot.
Explanation / Answer
ANS:-
Given that,
Below is the modified Map Class. As mentioned in the question, no change is required in Reduce class as it counts different lengths. Map function is changed so that it will create a Text as Length of the word as "Length 8" and it outputs <Text, IntWritable> as <key, value>. Changes are highlighted in Bold:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.