Skip to content

Instantly share code, notes, and snippets.

@milindjagre
Created April 16, 2016 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milindjagre/84cc1c230ffd10b7ec0b5db5a47f4c80 to your computer and use it in GitHub Desktop.
Save milindjagre/84cc1c230ffd10b7ec0b5db5a47f4c80 to your computer and use it in GitHub Desktop.
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