Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BB170200B87 for ; Mon, 19 Sep 2016 16:59:37 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B9CFD160ACC; Mon, 19 Sep 2016 14:59:37 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0A08E160ABB for ; Mon, 19 Sep 2016 16:59:36 +0200 (CEST) Received: (qmail 3223 invoked by uid 500); 19 Sep 2016 14:59:36 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 3212 invoked by uid 99); 19 Sep 2016 14:59:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Sep 2016 14:59:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 09C7CDFE60; Mon, 19 Sep 2016 14:59:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aihuaxu@apache.org To: commits@hive.apache.org Message-Id: <674d04c66a6c4179b2681ea54bcd3e75@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hive git commit: HIVE-14186: Display the exception message in MapReduce in beeline console (Aihua Xu, reviewed by Yongzhi Chen) Date: Mon, 19 Sep 2016 14:59:35 +0000 (UTC) archived-at: Mon, 19 Sep 2016 14:59:37 -0000 Repository: hive Updated Branches: refs/heads/master c90eed20d -> 662728fce HIVE-14186: Display the exception message in MapReduce in beeline console (Aihua Xu, reviewed by Yongzhi Chen) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/662728fc Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/662728fc Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/662728fc Branch: refs/heads/master Commit: 662728fce3ca31c3d1b27b16cf8a087f62deb578 Parents: c90eed2 Author: Aihua Xu Authored: Fri Sep 16 11:45:34 2016 -0400 Committer: Aihua Xu Committed: Mon Sep 19 10:52:32 2016 -0400 ---------------------------------------------------------------------- .../hadoop/hive/ql/exec/FunctionRegistry.java | 23 ++++++++------------ 1 file changed, 9 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/662728fc/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java index a854f9f..de74c3e 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java @@ -985,9 +985,6 @@ public final class FunctionRegistry { try { o = m.invoke(thisObject, arguments); } catch (Exception e) { - String thisObjectString = "" + thisObject + " of class " - + (thisObject == null ? "null" : thisObject.getClass().getName()); - StringBuilder argumentString = new StringBuilder(); if (arguments == null) { argumentString.append("null"); @@ -995,21 +992,19 @@ public final class FunctionRegistry { argumentString.append("{"); for (int i = 0; i < arguments.length; i++) { if (i > 0) { - argumentString.append(", "); - } - if (arguments[i] == null) { - argumentString.append("null"); - } else { - argumentString.append("" + arguments[i] + ":" - + arguments[i].getClass().getName()); + argumentString.append(","); } + + argumentString.append(arguments[i]); } - argumentString.append("} of size " + arguments.length); + argumentString.append("}"); } - throw new HiveException("Unable to execute method " + m + " " - + " on object " + thisObjectString + " with arguments " - + argumentString.toString(), e); + String detailedMsg = e instanceof java.lang.reflect.InvocationTargetException ? + e.getCause().getMessage() : e.getMessage(); + + throw new HiveException("Unable to execute method " + m + " with arguments " + + argumentString + ":" + detailedMsg, e); } return o; }