mirror of
https://github.com/apache/sqoop.git
synced 2025-05-03 07:42:00 +08:00
SQOOP-2257: Parquet target for imports with Hive overwrite option does not work
(Qian Xu via Jarek Jarcec Cecho)
This commit is contained in:
parent
38c054d8a2
commit
fa8518998f
@ -103,7 +103,9 @@ protected void configureMapper(Job job, String tableName,
|
||||
// Parquet data records. The import will fail, if schema is invalid.
|
||||
Schema schema = generateAvroSchema(tableName);
|
||||
String uri = getKiteUri(conf, tableName);
|
||||
ParquetJob.configureImportJob(conf, schema, uri, options.isAppendMode());
|
||||
boolean reuseExistingDataset = options.isAppendMode() ||
|
||||
(options.doHiveImport() && options.doOverwriteHiveTable());
|
||||
ParquetJob.configureImportJob(conf, schema, uri, reuseExistingDataset);
|
||||
}
|
||||
|
||||
job.setMapperClass(getMapperClass());
|
||||
|
@ -71,9 +71,9 @@ public static CompressionType getCompressionType(Configuration conf) {
|
||||
* {@link org.apache.avro.generic.GenericRecord}.
|
||||
*/
|
||||
public static void configureImportJob(Configuration conf, Schema schema,
|
||||
String uri, boolean doAppend) throws IOException {
|
||||
String uri, boolean reuseExistingDataset) throws IOException {
|
||||
Dataset dataset;
|
||||
if (doAppend) {
|
||||
if (reuseExistingDataset) {
|
||||
try {
|
||||
dataset = Datasets.load(uri);
|
||||
} catch (DatasetNotFoundException ex) {
|
||||
|
Loading…
Reference in New Issue
Block a user