} catch (HIHOException e1) {
e1.printStackTrace();
throw new IOException(e1);
}
Job job = new Job(conf);
job.setJobName("OracleLoading");
job.setMapperClass(OracleLoadMapper.class);
job.setJarByClass(ExportToOracleDb.class);
job.getConfiguration().setInt(MRJobConfig.NUM_MAPS,
conf.getInt(HIHOConf.NUMBER_MAPPERS, 1));
try {
// we first create the external table definition
String query = conf.get(HIHOConf.EXTERNAL_TABLE_DML);
// create table if user has specified
if (query != null) {
this.runQuery(query, conf);
}
} catch (HIHOException e1) {
e1.printStackTrace();
}
// verify required properties are loaded
job.setNumReduceTasks(0);
job.setInputFormatClass(FileStreamInputFormat.class);
FileStreamInputFormat.addInputPath(job, new Path(inputPath));
job.setMapOutputKeyClass(NullWritable.class);
job.setMapOutputValueClass(NullWritable.class);
// job.setJarByClass(com.mysql.jdbc.Driver.class);
job.setOutputFormatClass(NullOutputFormat.class);
int ret = 0;
try {
ret = job.waitForCompletion(true) ? 0 : 1;
} catch (Exception e) {
e.printStackTrace();
}
// run alter table query and add locations
try {