String tableName = context.getTableName();
String jarFile = context.getJarFile();
SqoopOptions options = context.getOptions();
MySQLDumpImportJob importer = null;
try {
importer = new MySQLDumpImportJob(options, context);
} catch (ClassNotFoundException cnfe) {
throw new IOException("Could not load required classes", cnfe);
}
String splitCol = getSplitColumn(options, tableName);
if (null == splitCol && options.getNumMappers() > 1) {
// Can't infer a primary key.
throw new ImportException("No primary key could be found for table "
+ tableName + ". Please specify one with --split-by or perform "
+ "a sequential import with '-m 1'.");
}
LOG.info("Beginning mysqldump fast path import");
if (options.getFileLayout() != SqoopOptions.FileLayout.TextFile) {
// TODO(aaron): Support SequenceFile-based load-in.
LOG.warn("File import layout " + options.getFileLayout()
+ " is not supported by");
LOG.warn("MySQL direct import; import will proceed as text files.");
}
importer.runImport(tableName, jarFile, splitCol, options.getConf());
}