Posts: 6
Registered: ‎09-07-2017

Compilation issues when RCFileInputFormat is set as InputFormatClass in new mapreduce API

[ Edited ]

I am trying to read RCFiles in the mapper phase. I was successful in achieving this using old mapred API's.



import org.apache.hadoop.mapred.JobConf;

JobConf conf = new JobConf(config, MRDriver.class); conf.setInputFormat(RCFileInputFormat.class);



Refactored the code to use new mapreduce API's as below, 



import org.apache.hadoop.mapreduce.Job;

Job job = new Job(config, "Triplets join"); job.setJarByClass(MRDriver.class); job.setInputFormatClass(RCFileInputFormat.class);



i'm getting compilation issues in the below line :








The method setInputFormatClass(Class<? extends InputFormat>) in the type Job is not applicable for the arguments (Class<RCFileInputFormat>)



Also, RCFileInputFormat.setInputPaths(JobConf conf, String commaSeparatedPaths) doesn't seem to accept Job as argument. Instead, it uses deprecated JobConf.


Why am I facing compilation issues when trying to use new API's. RCFileInputFormat is not implemented using new mapreduce API's ?? I need some suggestions on how to proceed with this.