Question

I am trying to write data from hbase to hdfs and encountered this error in compilation. Is it problem with the reducer code or something else?

HbaseFile.java:36: setReducerClass(java.lang.Class) in org.apache.hadoop.mapreduce.Job cannot be applied to (java.lang.Class) job.setReducerClass(CountWordReducer.class); ^ HbaseFile.java:38: setOutputPath(org.apache.hadoop.mapred.JobConf,org.apache.hadoop.fs.Path) in org.apache.hadoop.mapred.FileOutputFormat cannot be applied to (org.apache.hadoop.mapreduce.Job,org.apache.hadoop.fs.Path) FileOutputFormat.setOutputPath(job, new Path(args[0]));

Was it helpful?

Solution

From the packages you are using you are mixing the older and new api. To fix this problem you will have to pick one and use it consistently.

Notice your Job is the new api org.apache.hadoop.mapreduce.Job. But you're trying to use the old api to set the outputpath, I can tell because it takes the old JobConf org.apache.hadoop.mapred.JobConf.

If you see "org.apache.hadoop.mapreduce", and "org.apache.hadoop.mapred" in your code at the same time, you are probably mixing the api's and should change things around to pick just one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top