Hadoop streaming example failed Type mismatch in key from map [duplicate]
Possible Duplicate:
hadoop-streaming example failed to run - Type mismatch in key from map
When I ran Hadoop streaming example, it failed with Type mismatch in key from map
Hadoop version 0.21.0 input file content:
adfad
adfasdflkjlj
Command line: $HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/hadoop-streaming.jar \ -input myInputDirs \ -output myOutputDir \ -mapper org.apache.hadoop.mapred.lib.IdentityMapper \ -reducer /bin/wc
Error I got:
java.lang.Exception: java.io.IOException: Type mis开发者_如何学编程match in key from map: expected org.apache.hadoop.io.Text, recieved org.apache.hadoop.io.LongWritable
Please advise. What did I do wrong? Thanks
EDIT: Sorry, didn't realize this is Streaming. You need to customize how your output is split into Key/Value pairs. The documentation is here: http://hadoop.apache.org/common/docs/current/streaming.html#Customizing+How+Lines+are+Split+into+Key%2FValue+Pairs
It's a known bug in the release versions of Hadoop. It has been fixed in the code, but has to be released. Alternate solution provided here.
精彩评论