Brian Tan created PIG-2718:
------------------------------

             Summary: Error casting Long to Double inside the COV UDF
                 Key: PIG-2718
                 URL: https://issues.apache.org/jira/browse/PIG-2718
             Project: Pig
          Issue Type: Bug
    Affects Versions: 0.10.0, 0.9.2
            Reporter: Brian Tan


1.txt:
1, 2, 3
4, 5, 6
7, 8, 9

a = load '1.txt' using PigStorage(',') as (x:double, y:double, z:double);
b = group a all;
c = foreach b generate COV(a.$0, a.$0);

Following exception is thrown:
Caused by: java.io.IOException: Caught exception processing input
        at org.apache.pig.builtin.COV.combine(COV.java:279)
        at org.apache.pig.builtin.COV$Intermed.exec(COV.java:170)
Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to 
java.lang.Double
        at org.apache.pig.builtin.COV.combine(COV.java:266)

http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/builtin/COV.java

This can be easily fixed by changing count on line 259 from double to long, and 
tempCount on line 221 from double to long


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to