Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive, mail # user - Where is exception stacktrace and root cause for UDF


Copy link to this message
-
Where is exception stacktrace and root cause for UDF
Marc Limotte 2013-03-20, 20:01
Hi.

I'm trying to understand what happens to Exceptions that are thrown by
custom UDFs.  I have a UDF that throws a RuntimeException with useful
debugging information, but I don't see it in any logs.  I'm running my
commands using the hive cli (Hive 0.9.0).  Instead I see:

FAILED: Error in semantic analysis: Line 3:7 Wrong arguments '600':
> org.apache.hadoop.hive.ql.metadata.HiveException: Unable to execute method
> … evaluate(...) on object ...
> Command exited with non-zero status 10
Despite the "semantic analysis" error, I know it's getting to the
evaluate(…) method because of other log messages.

Looking in org.apache.hadoop.hive.ql.exec.FunctionRegistry, I find the
invoke method, which contains:

 public static Object invoke(Method m, Object thisObject, Object...
arguments)
      throws HiveException {
    Object o;
    try {
      o = m.invoke(thisObject, arguments);
    } catch (Exception e) {
      ...
      throw new HiveException("Unable to execute method " + m + " "
          + " on object " + thisObjectString + " with arguments "
          + argumentString.toString(), e);
    }
    return o;
  }

So it appears that my RuntimeException is wrapped in HiveException.  But
then it looks like only the Exception message is printed by the hive cli.
 Does the stack trace and root cause get printed in some log?  I didn't
find it anywhere.
Marc
+
Harsh J 2013-03-20, 23:06
+
FangKun Cao 2013-03-21, 08:16