github - Caused by: java.lang.ClassCastException: org.apache.hadoop.io.LongWritable cannot be cast to org.apache.hadoop.io.Text -
i trying compile following github project https://github.com/digitalpebble/behemoth/tree/master/uima
i following error java.lang.classcastexception: org.apache.hadoop.io.longwritable cannot cast org.apache.hadoop.io.text
code has following output key , value class defined. behemothdocument custom class defined
job.setinputformat(sequencefileinputformat.class); job.setoutputformat(sequencefileoutputformat.class); job.setmapoutputkeyclass(text.class); job.setmapoutputvalueclass(behemothdocument.class); job.setoutputkeyclass(text.class); job.setoutputvalueclass(behemothdocument.class);
map class looks below
public class uimamapper extends mapreducebase implements mapper<text, behemothdocument, text, behemothdocument> {
and map function follows
public void map(text id, behemothdocument behemoth, outputcollector<text, behemothdocument> output, reporter reporter)
i have seen couple of answers above error in stack overflow asking change mapper key, value type don't want do. know how use custom class.
please on . below stack trace info
java.lang.exception: java.lang.classcastexception: org.apache.hadoop.io.longwritable cannot cast org.apache.hadoop.io.text @ org.apache.hadoop.mapred.localjobrunner$job.run(localjobrunner.java:354) caused by: java.lang.classcastexception: org.apache.hadoop.io.longwritable cannot cast org.apache.hadoop.io.text @ uimapackage.uimamapper.map(uimamapper.java:35) @ org.apache.hadoop.mapred.maprunner.run(maprunner.java:50) @ org.apache.hadoop.mapred.maptask.runoldmapper(maptask.java:430) @ org.apache.hadoop.mapred.maptask.run(maptask.java:366) @ org.apache.hadoop.mapred.localjobrunner$job$maptaskrunnable.run(localjobrunner.java:223) @ java.util.concurrent.executors$runnableadapter.call(executors.java:471) @ java.util.concurrent.futuretask.run(futuretask.java:262) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:745)
instead of text use longwritable input key type mapper. should work.
Comments
Post a Comment