You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Marc Limotte <ms...@gmail.com> on 2013/03/20 21:01:36 UTC

Where is exception stacktrace and root cause for UDF

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

Re: Where is exception stacktrace and root cause for UDF

Posted by FangKun Cao <ca...@gmail.com>.
Hi  you can find the Exception log at map or reduce task logs .


http://your_task_tracker:50060/tasklog?taskid=attempt_20130*********_*********_r_000000_0&all=true


2013/3/21 Harsh J <ha...@cloudera.com>

> They should be viewable if you enable the DEBUG mode.
>
> hive -hiveconf hive.root.logger=DEBUG,console
>
> On Thu, Mar 21, 2013 at 1:31 AM, Marc Limotte <ms...@gmail.com> wrote:
> > 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
>



-- 
Best wishs!
Fangkun.Cao

Re: Where is exception stacktrace and root cause for UDF

Posted by Harsh J <ha...@cloudera.com>.
They should be viewable if you enable the DEBUG mode.

hive -hiveconf hive.root.logger=DEBUG,console

On Thu, Mar 21, 2013 at 1:31 AM, Marc Limotte <ms...@gmail.com> wrote:
> 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