Repository: hive
Updated Branches:
  refs/heads/master beaa56d02 -> d934156e4


HIVE-13704: Don't call DistCp.execute() instead of DistCp.run() (Sergio Pena, 
reviewed by Ashutosh Chauhan)


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

Branch: refs/heads/master
Commit: d934156e424a0eb128afe9245786d02bd97a9a60
Parents: beaa56d
Author: Sergio Pena <sergio.p...@cloudera.com>
Authored: Tue Jul 12 13:30:15 2016 -0500
Committer: Sergio Pena <sergio.p...@cloudera.com>
Committed: Tue Jul 12 13:36:00 2016 -0500

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/shims/Hadoop23Shims.java   | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/d934156e/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
----------------------------------------------------------------------
diff --git 
a/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java 
b/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
index 571bb25..155567e 100644
--- a/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
+++ b/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
@@ -1037,11 +1037,21 @@ public class Hadoop23Shims extends HadoopShimsSecure {
     options.setSyncFolder(true);
     options.setSkipCRC(true);
     options.preserve(FileAttribute.BLOCKSIZE);
+
+    // Creates the command-line parameters for distcp
+    String[] params = {"-update", "-skipcrccheck", src.toString(), 
dst.toString()};
+
     try {
       conf.setBoolean("mapred.mapper.new-api", true);
       DistCp distcp = new DistCp(conf, options);
-      distcp.execute();
-      return true;
+
+      // HIVE-13704 states that we should use run() instead of execute() due 
to a hadoop known issue
+      // added by HADOOP-10459
+      if (distcp.run(params) == 0) {
+        return true;
+      } else {
+        return false;
+      }
     } catch (Exception e) {
       throw new IOException("Cannot execute DistCp process: " + e, e);
     } finally {

Reply via email to