mirror of
https://github.com/apache/sqoop.git
synced 2025-05-03 20:40:58 +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.
|
// Parquet data records. The import will fail, if schema is invalid.
|
||||||
Schema schema = generateAvroSchema(tableName);
|
Schema schema = generateAvroSchema(tableName);
|
||||||
String uri = getKiteUri(conf, 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());
|
job.setMapperClass(getMapperClass());
|
||||||
|
@ -71,9 +71,9 @@ public static CompressionType getCompressionType(Configuration conf) {
|
|||||||
* {@link org.apache.avro.generic.GenericRecord}.
|
* {@link org.apache.avro.generic.GenericRecord}.
|
||||||
*/
|
*/
|
||||||
public static void configureImportJob(Configuration conf, Schema schema,
|
public static void configureImportJob(Configuration conf, Schema schema,
|
||||||
String uri, boolean doAppend) throws IOException {
|
String uri, boolean reuseExistingDataset) throws IOException {
|
||||||
Dataset dataset;
|
Dataset dataset;
|
||||||
if (doAppend) {
|
if (reuseExistingDataset) {
|
||||||
try {
|
try {
|
||||||
dataset = Datasets.load(uri);
|
dataset = Datasets.load(uri);
|
||||||
} catch (DatasetNotFoundException ex) {
|
} catch (DatasetNotFoundException ex) {
|
||||||
|
Loading…
Reference in New Issue
Block a user