This is strange. Looking at COUNT code, there does not seem to be anyway it 
could return a float.
Do you have some example data/query that can be used to reproduce this ?
Can you paste the entire stacktrace of the ClassCastException ?
Do you have something like a bincond which might be returning different results 
for different rows ?

-Thejas




On 4/15/11 2:44 PM, "Jeremy Hanna" <[email protected]> wrote:

I have been getting strange errors in my pig script and narrowed it down a bit 
and found that when I do a COUNT, sometimes it returns a float, but most of the 
time it returns a long.  Some example output of the result column that came 
from a COUNT is below.  Any reason why this would happen?

The error that started me down this path was in my next step, I cast the count 
value as a chararray and it gives the error "java.lang.ClassCastException: 
java.lang.Float cannot be cast to java.lang.Long" which made no sense to me 
since we weren't casting anything in our script to a long.

(0)
(0)
(0.0)
(0.0)
(0)
(0)
(0)
(0)
(0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0)
(0.0)
(0.0)
(0)
(0.0)
(0.0)
(0)
(0)
(0)
(0)
(0.0)
(0)
(0)
(0.0)
(0)
(0)
(0)
(0.0)
(0.0)
(0.0)
(0)
(0.0)
(0.0)
(0)
(0)
(0)
(0.0)
(0)
(0.0)
(0.0)
(0.0)
(0)
(0)
(0)
(0.0)
(0.0)
(0.0)
(0.0)
(0)
(0.0)
(0.0)
(0.0)
(0)
(0)
(0.0)
(0)
(0.0)
(0)
(0.0)
(0.0)
(0)
(0)
(0.0)
(0)
(0)
(0)
(0.0)
(0)
(0)
(0.0)
(0.0)
(0)
(0)
(0.0)
(0)
(0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0)
(0.0)
(0)
(0.0)
(0)
(0.0)
(0.0)
(0.0)
(0.0)
(0)
(0)
(0.0)
(0)
(0.0)
(0.0)
(0)
(0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0.0)
(0)
(0.0)
(0.0)
(0)
(0.0)
(0)
(0.0)
(0.0)
(0)
(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