FAQ
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();

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedApr 11, '16 at 3:14a
activeApr 11, '16 at 3:14a
posts1
users1
websitehive.apache.org

1 user in discussion

Jxiang: 1 post

People

Translate

site design / logo © 2021 Grokbase