[
https://issues.apache.org/jira/browse/PIG-3679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Cheolsoo Park updated PIG-3679:
-------------------------------
Attachment: PIG-3679-2.patch
OK, I found this is a regression of PIG-3568 (Define the semantics of
POStatus.STATUS_NULL). If I drop PIG-3568 in trunk, the test passes. In shorts,
the exec() in DoubleRound was never called with nulls in 0.12, whereas it is in
trunk resulting in NPE.
In terms of the fix, I think we should explicitly handle NullPointerException
in addition to NumberFormatException in ROUND, DoubleRound, and FloatRound.
Currently, if input.get(0) returns null, Math.round() will throw NPE.
I am attaching a new patch that adds a null check before calling Math.round().
I also copied the handler for NumberFormatException from ROUND to DoubleRound
and FloadRound since it was missing in those functions.
> e2e StreamingPythonUDFs_10 fails in trunk
> -----------------------------------------
>
> Key: PIG-3679
> URL: https://issues.apache.org/jira/browse/PIG-3679
> Project: Pig
> Issue Type: Bug
> Reporter: Cheolsoo Park
> Assignee: Cheolsoo Park
> Fix For: 0.13.0
>
> Attachments: PIG-3679-1.patch, PIG-3679-2.patch
>
>
> The e2e test StreamingPythonUDFs_10 fails in trunk with NPE-
> {code}
> Caused by: java.lang.NullPointerException
> at org.apache.pig.builtin.DoubleRound.exec(DoubleRound.java:45)
> {code}
> The test query is as follows-
> {code}
> a = load '/user/pig/tests/data/singlefile/allscalar10k' using PigStorage() as
> (name:chararray, age:int, gpa:double, instate:chararray);
> b = foreach a generate name,
> ((double)ROUND((instate=='true'?gpa:gpa+1)*10000)) / 10000.0;
> store b into
> '/user/pig/out/cheolsoop-1390330024-nightly.conf-StreamingPythonUDFs/StreamingPythonUDFs_10_benchmark.out';
> {code}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)