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

Switch to Plain View
Pig, mail # user - Determining cause of UDF exception


+
rob parker 2011-11-04, 15:33
Copy link to this message
-
Re: Determining cause of UDF exception
pablomar 2011-11-04, 17:06
i use
catch(Exception e) {
throw WrappedIOException.wrap("you message " + e.getMessage(), e);

On 11/4/11, rob parker <[EMAIL PROTECTED]> wrote:
> I have a UDF to output JSON. (PIG v0.9.1, Hadoop 0.20.204)
>
> I have tested the setup outside of pig and Jackson will produce a JSON
> string.
>
> However in the UDF I am getting:
>
> ERROR 2997: Unable to recreate exception from backed error: Error:
> org.codehaus.jackson.map.ObjectMapper.writeValueAsString(Ljava/lang/Object;)Ljava/lang/String;
>
> in the putNext(Tuple t) function:
>
> the aky object is POJO, and I have tested the hardcoded setup (which is
> also used in the UDF for now) in a separate Java main block it eliminate
> the extreme obvious.
>
> I have tried to rethrow a PigException to get some idea of which exception
> is causing the issue.
>
>                         ObjectMapper mapper = new ObjectMapper();
> String jsonOutput = null;
> try {
> jsonOutput = mapper.writeValueAsString(aky);
> Text text = new Text(jsonOutput);
> writer.write(null, text);
> } catch (JsonGenerationException e) {
>  e.printStackTrace();
> throw new PigException(e);
> } catch (JsonMappingException e) {
>  e.printStackTrace();
> throw new PigException(e);
> } catch (IOException e) {
>  e.printStackTrace();
> throw new PigException(e);
>                         }
>
> Anyway to determine the actual exception or the root cause?
>
> thanks,
>
> rob
>
+
Dmitriy Ryaboy 2011-11-04, 23:20