sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject sqoop git commit: SQOOP-2257: Parquet target for imports with Hive overwrite option does not work
Date Tue, 24 Mar 2015 13:43:49 GMT
Repository: sqoop
Updated Branches:
  refs/heads/trunk 38c054d8a -> fa8518998


SQOOP-2257: Parquet target for imports with Hive overwrite option does not work

(Qian Xu via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/fa851899
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/fa851899
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/fa851899

Branch: refs/heads/trunk
Commit: fa8518998f527653587c8f74ebf9990c22842dbb
Parents: 38c054d
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Tue Mar 24 06:43:30 2015 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Tue Mar 24 06:43:30 2015 -0700

----------------------------------------------------------------------
 src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java | 4 +++-
 src/java/org/apache/sqoop/mapreduce/ParquetJob.java          | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/fa851899/src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java b/src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java
index 708da5b..bcf6611 100644
--- a/src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java
+++ b/src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java
@@ -103,7 +103,9 @@ public class DataDrivenImportJob extends ImportJobBase {
       // 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());

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fa851899/src/java/org/apache/sqoop/mapreduce/ParquetJob.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/mapreduce/ParquetJob.java b/src/java/org/apache/sqoop/mapreduce/ParquetJob.java
index bea74c3..85d88ff 100644
--- a/src/java/org/apache/sqoop/mapreduce/ParquetJob.java
+++ b/src/java/org/apache/sqoop/mapreduce/ParquetJob.java
@@ -71,9 +71,9 @@ public final class ParquetJob {
    * {@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) {


Mime
View raw message