[ 
https://issues.apache.org/jira/browse/PIG-3858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13958136#comment-13958136
 ] 

Lorand Bendig commented on PIG-3858:
------------------------------------

[~cheolsoo], thank you for your remarks. In case of aggregate warnings checking 
only pigLogger is fine. But what about those cases where counters are accessed 
via PigStatusReporter? E.g in POUserFunc:
{code}PigStatusReporter.getInstance().getCounter(counterGroup, 
INVOCATION_COUNTER).increment(TIMING_FREQ);{code}
It is usually assumed that counters are always available, but this is not the 
case in fetch mode where TaskInputOutputContext is null. The mock context will 
prevent POs/UDFs throwing NPEs and will be probably handy once PIG-2620 is 
accomplished (FailOnThreshold error handler would use counters).



> PigLogger/PigStatusReporter is not set for fetch tasks
> ------------------------------------------------------
>
>                 Key: PIG-3858
>                 URL: https://issues.apache.org/jira/browse/PIG-3858
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Lorand Bendig
>            Assignee: Lorand Bendig
>         Attachments: PIG-3858.patch
>
>
> PigLogger initialization is missing which leads to NPE if counters are 
> accessed during a fetch tasks. Some queries to reproduce this issue:
> 1.
> {code}
> set opt.fetch true;
> A = load ...
> B = foreach A generate TOBAG(TOTUPLE(null));
> dump B;
> {code}
> -> NPE when PigWarning.SKIP_UDF_CALL_FOR_NULL is incremented
> 2.
> {code}
> set opt.fetch true;
> set pig.udf.profile true;
> A = load ...
> B = foreach A generate [any UDF]
> {code}
> -> NPE when POUserFunc.INVOCATION_COUNTER is incremented



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to