hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject hive git commit: HIVE-13430: Pass error message to failure hook (Jimmy, reviewed by Szehon)
Date Mon, 11 Apr 2016 03:14:53 GMT
Repository: hive
Updated Branches:
  refs/heads/master 42fa60af4 -> 1cb4ce871


HIVE-13430: Pass error message to failure hook (Jimmy, reviewed by Szehon)


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

Branch: refs/heads/master
Commit: 1cb4ce8714d216af6e1a9f6496392d07130dffbe
Parents: 42fa60a
Author: Jimmy Xiang <jxiang@apache.org>
Authored: Tue Apr 5 10:06:12 2016 -0700
Committer: Jimmy Xiang <jxiang@apache.org>
Committed: Sun Apr 10 20:14:11 2016 -0700

----------------------------------------------------------------------
 ql/src/java/org/apache/hadoop/hive/ql/Driver.java    | 15 ++++++++-------
 .../org/apache/hadoop/hive/ql/exec/MoveTask.java     |  1 +
 .../org/apache/hadoop/hive/ql/hooks/HookContext.java | 11 ++++++++++-
 3 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/1cb4ce87/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
index 65ed1db..abf94ff 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/Driver.java
@@ -36,13 +36,7 @@ import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.ReentrantLock;
 
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Sets;
-
 import org.apache.commons.lang.StringUtils;
-import org.apache.hadoop.mapreduce.MRJobConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.hive.common.ValidTxnList;
 import org.apache.hadoop.hive.conf.HiveConf;
@@ -118,7 +112,13 @@ import org.apache.hadoop.hive.shims.Utils;
 import org.apache.hadoop.mapred.ClusterStatus;
 import org.apache.hadoop.mapred.JobClient;
 import org.apache.hadoop.mapred.JobConf;
+import org.apache.hadoop.mapreduce.MRJobConfig;
 import org.apache.hive.common.util.ShutdownHookManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
 
 public class Driver implements CommandProcessor {
 
@@ -1629,7 +1629,9 @@ public class Driver implements CommandProcessor {
             continue;
 
           } else {
+            setErrorMsgAndDetail(exitVal, result.getTaskError(), tsk);
             hookContext.setHookType(HookContext.HookType.ON_FAILURE_HOOK);
+            hookContext.setErrorMessage(errorMessage);
             // Get all the failure execution hooks and execute them.
             for (Hook ofh : getHooks(HiveConf.ConfVars.ONFAILUREHOOKS)) {
               perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.FAILURE_HOOK + ofh.getClass().getName());
@@ -1638,7 +1640,6 @@ public class Driver implements CommandProcessor {
 
               perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.FAILURE_HOOK + ofh.getClass().getName());
             }
-            setErrorMsgAndDetail(exitVal, result.getTaskError(), tsk);
             SQLState = "08S01";
             console.printError(errorMessage);
             driverCxt.shutdown();

http://git-wip-us.apache.org/repos/asf/hive/blob/1cb4ce87/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
index 4a546d1..54592cc 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
@@ -527,6 +527,7 @@ public class MoveTask extends Task<MoveWork> implements Serializable
{
     } catch (Exception e) {
       console.printError("Failed with exception " + e.getMessage(), "\n"
           + StringUtils.stringifyException(e));
+      setException(e);
       return (1);
     }
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/1cb4ce87/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookContext.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookContext.java b/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookContext.java
index bed17e9..6fd1f66 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookContext.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/hooks/HookContext.java
@@ -51,6 +51,7 @@ public class HookContext {
   private Index depMap;
   private UserGroupInformation ugi;
   private HookType hookType;
+  private String errorMessage;
   final private Map<String, ContentSummary> inputPathToContentSummary;
   private final String ipAddress;
   private final String userName;
@@ -161,7 +162,15 @@ public class HookContext {
 
   public String getIpAddress() {
     return this.ipAddress;
- }
+  }
+
+  public void setErrorMessage(String errorMessage) {
+    this.errorMessage = errorMessage;
+  }
+
+  public String getErrorMessage() {
+    return errorMessage;
+  }
 
   public String getOperationName() {
     return queryPlan.getOperationName();


Mime
View raw message