Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Determining cause of UDF exception


Copy link to this message
-
Re: Determining cause of UDF exception
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
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB