mirror of
https://github.com/apache/sqoop.git
synced 2025-05-03 21:12:38 +08:00
SQOOP-1494: Fix generateArvoSchema in DataDrivenImportJob
(Qian Xu via Jarek Jarcec Cecho)
This commit is contained in:
parent
41724c31d4
commit
e23d1571bd
@ -88,7 +88,7 @@ protected void configureMapper(Job job, String tableName,
|
||||
job.setOutputValueClass(NullWritable.class);
|
||||
} else if (options.getFileLayout()
|
||||
== SqoopOptions.FileLayout.AvroDataFile) {
|
||||
Schema schema = generateArvoSchema(tableName);
|
||||
Schema schema = generateAvroSchema(tableName);
|
||||
try {
|
||||
writeAvroSchema(schema);
|
||||
} catch (final IOException e) {
|
||||
@ -101,7 +101,7 @@ protected void configureMapper(Job job, String tableName,
|
||||
Configuration conf = job.getConfiguration();
|
||||
// An Avro schema is required for creating a dataset that manages
|
||||
// Parquet data records. The import will fail, if schema is invalid.
|
||||
Schema schema = generateArvoSchema(tableName);
|
||||
Schema schema = generateAvroSchema(tableName);
|
||||
String uri;
|
||||
if (options.doHiveImport()) {
|
||||
uri = "dataset:hive?dataset=" + options.getTableName();
|
||||
@ -115,7 +115,7 @@ protected void configureMapper(Job job, String tableName,
|
||||
job.setMapperClass(getMapperClass());
|
||||
}
|
||||
|
||||
private Schema generateArvoSchema(String tableName) throws IOException {
|
||||
private Schema generateAvroSchema(String tableName) throws IOException {
|
||||
ConnManager connManager = getContext().getConnManager();
|
||||
AvroSchemaGenerator generator = new AvroSchemaGenerator(options,
|
||||
connManager, tableName);
|
||||
|
Loading…
Reference in New Issue
Block a user