You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Cheolsoo Park (JIRA)" <ji...@apache.org> on 2013/11/27 20:46:35 UTC

[jira] [Commented] (PIG-2132) Piggybank: MIN and MAX functions should ignore nulls

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

Cheolsoo Park commented on PIG-2132:
------------------------------------

[~rekhajoshm], thank you for the patch. But your patch includes several errors. In fact, it doesn't even compile-
{code}
    [javac] /Users/cheolsoop/workspace/pig-svn/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/evaluation/TestMathUDF.java:528: incompatible types
    [javac] found   : <nulltype>
    [javac] required: double
    [javac]         double expected = null;
    [javac]                           ^
    [javac] /Users/cheolsoop/workspace/pig-svn/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/evaluation/TestMathUDF.java:609: incompatible types
    [javac] found   : <nulltype>
    [javac] required: float
    [javac]         float expected = null;
    [javac]                          ^
{code}
Also, it looks like you manually edited your patch.
{code}
+	-	 public void testnextAfter() throws Exception {
{code}

I am dropping the changes in TestMathUDF.java and will only commit the rest.

Next time when you contribute, please run the unit test before posting a patch. Here is how you run piggybank unit tests-
{code}
ant compile-test
cd contrib/piggybank/java
ant test -Dtestcase=TestMathUDF
{code}

> Piggybank: MIN and MAX functions should ignore nulls
> ----------------------------------------------------
>
>                 Key: PIG-2132
>                 URL: https://issues.apache.org/jira/browse/PIG-2132
>             Project: Pig
>          Issue Type: Bug
>          Components: tools
>    Affects Versions: 0.10.1
>            Reporter: Jonathan Coveney
>            Priority: Minor
>              Labels: newbie, piggybank
>         Attachments: JcoMaxMinPatch.patch, JcoMaxMinPatch_wtests.patch, PIG-2132_1.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> org.apache.pig.piggybank.evaluation.math.MAX and org.apache.pig.piggybank.evaluation.math.MIN throws a NullPointerException on a null input, when it should just ignore it.



--
This message was sent by Atlassian JIRA
(v6.1#6144)