Ozzie hadoop action error : type mismatch
NickName:Nemil A Timbadia Ask DateTime:2013-08-06T04:09:53

Ozzie hadoop action error : type mismatch

I am having a problem when I run my Hadoop Jobs via OOzie. I have run the jobs normally with the following configuration:

public int run(String[] args) throws Exception {
        // TODO Auto-generated method stub
        Job job = new Job(getConf(), "GCAnalyzer");

        job.setJarByClass(GCMapper.class);

        job.setMapperClass(getMapperClass());
        job.setReducerClass(getReducerClass());

        job.setOutputKeyClass(Text.class);
        job.setOutputValueClass(NullWritable.class);

        job.setInputFormatClass(TextInputFormat.class);
        job.setOutputFormatClass(TextOutputFormat.class);

        FileInputFormat.addInputPath(job, new Path(args[0]));
        FileOutputFormat.setOutputPath(job, new Path(args[1]));

        job.setNumReduceTasks(1);

        return job.waitForCompletion(true) ? 0 : 1;
    }

    public static void main(String args[]) throws Exception {
        int res = ToolRunner.run(new Configuration(), new GCMapper(), args);
        System.exit(res);
    }

When I run the same job with the following OOzie config I get error:

<workflow-app xmlns="uri:oozie:workflow:0.2" name="log_analysis">
<start to="gclogs" /> 
<action name="gclogs">

<map-reduce>
    <job-tracker>${jobTracker}</job-tracker> 
    <name-node>${nameNode}</name-node> 
    <prepare>
    <delete path="${gcouput}"/>
    </prepare>

    <configuration>

<property>
  <name>mapred.mapper.new-api</name> 
  <value>true</value> 
  </property>

 <property>
  <name>mapred.reducer.new-api</name> 
  <value>true</value> 
  </property>

<property>
<name>mapred.map.class</name> 
<value>${gcmapper}</value>
</property>

<property>
<name>mapreduce.reduce.class</name> 
<value>${gcreducer}</value> 
</property>



<property>
<name>mapred.mapoutput.key.class</name> 
 <value>org.apache.hadoop.io.Text</value> 
 </property>

<property>
 <name>mapred.mapoutput.value.class</name> 
 <value>org.apache.hadoop.io.NullWritable</value> 
 </property>

<property> 
 <name>mapreduce.inputformat.class</name> 
 <value>org.apache.hadoop.mapreduce.lib.input.TextInputFormat</value> 
 </property>


 <property>
  <name>mapreduce.outputformat.class</name> 
  <value>org.apache.hadoop.mapreduce.lib.output.TextOutputFormat</value> 
  </property>



<property>
<name>mapred.input.dir</name> 
<value>${gcinput}</value>
</property>

<property>
<name>mapred.output.dir</name> 
<value>${gcoutput}</value>
</property>

<property>
  <name>mapred.reduce.tasks</name> 
  <value>1</value> 
  </property>

<property>
  <name>mapred.job.queue.name</name> 
  <value>default</value> 
  </property>


</configuration>
</map-reduce>
<ok to="end" /> 
 <error to="fail" /> 
</action>

 <kill name="fail">
  <message>Map/Reduce failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message> 
  </kill>
  <end name="end" /> 

</workflow-app>

Job properties file as follows:

oozie.wf.application.path=${nameNode}/user/svc_hdp/ozzie/apps/log_analyzer
oozie.libpath=${nameNode}/user/svc_hdp/oozie/apps/share-lib

nameNode=hdfs://path
jobTracker=path
queueName=default


# GCMApred
gcinput=${nameNode}/user/a.ntimbadi/inputgc
gcoutput=${nameNode}/user/a.ntimbadi/ouputgc
gcmapper=edu.*******.hadoop.log.GCMapper$CasMap
gcreducer=org.apache.hadoop.mapreduce.Reducer

Error is as follows:

java.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, recieved org.apache.hadoop.io.LongWritable

I am sure that my hadoop code is fine since it runs when I run it manually. Something wrong with my oozie config. Please let me know if there is an obvious error.

Copyright Notice:Content Author:「Nemil A Timbadia」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/18066819/ozzie-hadoop-action-error-type-mismatch

More about “Ozzie hadoop action error : type mismatch” related questions

Ozzie hadoop action error : type mismatch

I am having a problem when I run my Hadoop Jobs via OOzie. I have run the jobs normally with the following configuration: public int run(String[] args) throws Exception { // TODO Auto-gene...

Show Detail

Run install pig from ozzie hadoop

I have installed oozie on my system and I have also installed pig. Now I want ozzie to run workflow from pig which is installed on my system not from the ozzie sharelib. Please help, as I get ...

Show Detail

MapReduce with Hadoop: Type mismatch in key from map

I'm running a simple wordcount program, and I get the following error: Type mismatch in key from map: expected org.apache.hadoop.io.Text, received org.apache.hadoop.io.LongWritable What is the me...

Show Detail

Hadoop Stream Job Error (Type mismatch in key from map)

I know that there are few identical issues reported. In my case my case I wrote Mr. jobs on R in regular way. I know there is a way to use RHadoop to access hadoop directly from R though. I execu...

Show Detail

MapReduce with Hadoop: Type mismatch

I'm running a simple hadoop program, and I get the following error: java.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, recieved org.apache.hadoop.io.LongWritab...

Show Detail

hadoop-streaming example failed to run - Type mismatch in key from map

I was running $HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/hadoop-streaming.jar \ -D stream.map.output.field.separator=. \ -D stream.num.map.output.key.fields=4 \ -input myInputDirs \ -

Show Detail

Type mismatch in key from map In Hadoop Sorting

I am creating a simple hadoop sorting example, I have following code. I am using ready-made InverseMaper and Identity reducer FileInputFormat.setInputPaths(conf, new Path(args[0])); ...

Show Detail

hadoop exception type mismatch in wordcount program

I am new and try to run my first hadoop program. and I am facing some problem when I execute my wordcount job in hadoop. WordCount.java package hdp; import org.apache.hadoop.conf.Configuration; i...

Show Detail

Pig Version Mismatch (Hadoop)

Did anyone has met the problem before? This is error log: Protocol org.apache.hadoop.mapred.JobSubmissionProtocol version mismatch. (client = 20, server = 21) I used pig 0.8.0 and my hadoop versi...

Show Detail

Hadoop mismatch problems with spark?

I am trying to read from hdfs on hadoop 0.20 and am getting an error with client server mismatch. How do I get rid of this?

Show Detail