options.setTargetDir(destDir.toString());
// Local job tracker needs jars in the classpath.
loadJars(options.getConf(), context.getJarFile(), context.getTableName());
MergeJob mergeJob = new MergeJob(options);
if (mergeJob.runMergeJob()) {
// Rename destination directory to proper location.
Path tmpDir = getOutputPath(options, context.getTableName());
fs.rename(userDestDir, tmpDir);
fs.rename(destDir, userDestDir);
fs.delete(tmpDir, true);