Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This is Driver Class for reading Excel File using MapReduce
/* * To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor. */
package com.milind.mr.excel;
/**
* * @author milind
*/
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ExcelDriver {
private static Logger logger = LoggerFactory.getLogger(ExcelDriver.class);
public static void main(String[] args) throws Exception {
logger.info("Driver started");
Job job = new Job();
job.setJarByClass(ExcelDriver.class);
job.setJobName("Excel Record Reader");
job.setMapperClass(ExcelMapper.class);
job.setNumReduceTasks(0);
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
job.setInputFormatClass(ExcelInputFormat.class);
job.waitForCompletion(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.