You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by kh...@apache.org on 2016/06/06 01:02:04 UTC

hive git commit: HIVE-13941 : Improve errors returned from SchemaTool (Sushanth Sowmyan, reviewed by Vaibhav Gumashta)

Repository: hive
Updated Branches:
  refs/heads/master f6200e70c -> 26cdbe044


HIVE-13941 : Improve errors returned from SchemaTool (Sushanth Sowmyan, reviewed by Vaibhav Gumashta)


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

Branch: refs/heads/master
Commit: 26cdbe044b549dc4f0244ee9347387a802733553
Parents: f6200e7
Author: Sushanth Sowmyan <kh...@gmail.com>
Authored: Sun Jun 5 15:01:19 2016 -1000
Committer: Sushanth Sowmyan <kh...@gmail.com>
Committed: Sun Jun 5 15:01:19 2016 -1000

----------------------------------------------------------------------
 .../src/java/org/apache/hive/beeline/HiveSchemaTool.java | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/26cdbe04/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java b/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java
index 2d7910d..cd36ddf 100644
--- a/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java
+++ b/beeline/src/java/org/apache/hive/beeline/HiveSchemaTool.java
@@ -512,8 +512,19 @@ public class HiveSchemaTool {
       }
     } catch (HiveMetaException e) {
       System.err.println(e);
+      if (e.getCause() != null) {
+        Throwable t = e.getCause();
+        System.err.println("Underlying cause: "
+            + t.getClass().getName() + " : "
+            + t.getMessage());
+        if (e.getCause() instanceof SQLException) {
+          System.err.println("SQL Error code: " + ((SQLException)t).getErrorCode());
+        }
+      }
       if (line.hasOption("verbose")) {
         e.printStackTrace();
+      } else {
+        System.err.println("Use --verbose for detailed stacktrace.");
       }
       System.err.println("*** schemaTool failed ***");
       System.exit(1);