Created
April 16, 2016 02:19
-
-
Save milindjagre/84cc1c230ffd10b7ec0b5db5a47f4c80 to your computer and use it in GitHub Desktop.
This is Driver Class for reading Excel File using MapReduce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* * 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