You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ai...@apache.org on 2018/07/12 21:10:47 UTC

hive git commit: HIVE-20037: Print root cause exception's toString() rather than getMessage() (Aihua Xu, reviewed by Sahil Takiar)

Repository: hive
Updated Branches:
  refs/heads/master a3eacb9dd -> 57dd30441


HIVE-20037: Print root cause exception's toString() rather than getMessage() (Aihua Xu, reviewed by Sahil Takiar)


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

Branch: refs/heads/master
Commit: 57dd30441a708f9fe653aea1c54df678ed459c34
Parents: a3eacb9
Author: Aihua Xu <ai...@apache.org>
Authored: Fri Jun 29 14:40:43 2018 -0700
Committer: Aihua Xu <ai...@apache.org>
Committed: Thu Jul 12 13:38:12 2018 -0700

----------------------------------------------------------------------
 .../hive/ql/exec/spark/session/SparkSessionImpl.java      | 10 +++-------
 .../exec/spark/session/TestSparkSessionManagerImpl.java   |  5 +++--
 2 files changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/57dd3044/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/session/SparkSessionImpl.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/session/SparkSessionImpl.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/session/SparkSessionImpl.java
index 6e37d93..0f2f031 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/session/SparkSessionImpl.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/session/SparkSessionImpl.java
@@ -215,18 +215,14 @@ public class SparkSessionImpl implements SparkSession {
               sessionId, matchedString.toString());
         } else {
           return new HiveException(e, ErrorMsg.SPARK_CREATE_CLIENT_ERROR, sessionId,
-                  getRootCause(oe));
+              Throwables.getRootCause(e).toString());
         }
       }
       e = e.getCause();
     }
 
-    return new HiveException(oe, ErrorMsg.SPARK_CREATE_CLIENT_ERROR, sessionId, getRootCause(oe));
-  }
-
-  private String getRootCause(Throwable e) {
-    Throwable rootCause = Throwables.getRootCause(e);
-    return rootCause.getClass().getName() + ": " + rootCause.getMessage();
+    return new HiveException(oe, ErrorMsg.SPARK_CREATE_CLIENT_ERROR, sessionId,
+        Throwables.getRootCause(oe).toString());
   }
 
   private boolean matches(String input, String regex, StringBuilder matchedString) {

http://git-wip-us.apache.org/repos/asf/hive/blob/57dd3044/ql/src/test/org/apache/hadoop/hive/ql/exec/spark/session/TestSparkSessionManagerImpl.java
----------------------------------------------------------------------
diff --git a/ql/src/test/org/apache/hadoop/hive/ql/exec/spark/session/TestSparkSessionManagerImpl.java b/ql/src/test/org/apache/hadoop/hive/ql/exec/spark/session/TestSparkSessionManagerImpl.java
index 15756da..6964764 100644
--- a/ql/src/test/org/apache/hadoop/hive/ql/exec/spark/session/TestSparkSessionManagerImpl.java
+++ b/ql/src/test/org/apache/hadoop/hive/ql/exec/spark/session/TestSparkSessionManagerImpl.java
@@ -180,8 +180,9 @@ public class TestSparkSessionManagerImpl {
         "initial executor number 5 must between min executor number10 and max executor number 50");
 
     // Other exceptions which defaults to SPARK_CREATE_CLIENT_ERROR
-    e = new Exception("Other exception");
-    checkHiveException(ss, e, ErrorMsg.SPARK_CREATE_CLIENT_ERROR, "Other exception");
+    e = new java.lang.NoClassDefFoundError("org/apache/spark/SparkConf");
+    checkHiveException(ss, e, ErrorMsg.SPARK_CREATE_CLIENT_ERROR,
+        "java.lang.NoClassDefFoundError: org/apache/spark/SparkConf");
   }
 
   private void checkHiveException(SparkSessionImpl ss, Throwable e, ErrorMsg expectedErrMsg) {