This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Hadoop and the fly likes Hadoop key mismatch Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Hadoop
Bookmark "Hadoop key mismatch" Watch "Hadoop key mismatch" New topic
Author

Hadoop key mismatch

Larry Homes
Greenhorn

Joined: Jan 18, 2009
Posts: 25
Hello,

Hope this is the correct forum for a hadoop question.

I have a file with a bunch of lines like this:



It continues on for all 50 states, then there is another word like politics:30 Virginia ... etc.

I want to do a distributed sort on this using mapreduce. I know mapreduce sorts between the map and reduces stages, so I just want to emit from map, then from reduce without processing, but it is not working. Here is my map and reduce function:



Here is my main class



And here is the inputformat class i wrote since FileInputFormat would always fail



Here is the error




Thanks
Larry Homes
Greenhorn

Joined: Jan 18, 2009
Posts: 25
Thought I would post the solution I found. It was an incredibly dumb error on my part. In my main class, I named the Job instance sort, but then when setting the mapOutputKey, mapOutputValues, outputKey and outputValue, I use the identifier job. That identifier was from a previous mapreduce in the chain and I had just copied and pasted the code without remembering to change the job identifier.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hadoop key mismatch