You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daeho Baek (JIRA)" <ji...@apache.org> on 2008/01/30 22:17:33 UTC

[jira] Created: (PIG-82) Loose floating point precision

Loose floating point precision
------------------------------

                 Key: PIG-82
                 URL: https://issues.apache.org/jira/browse/PIG-82
             Project: Pig
          Issue Type: Improvement
          Components: data
    Affects Versions: 0.1.0
            Reporter: Daeho Baek


Pig looses floating point precision during conversion between binary and string conversion.
Here is an example code.

words = LOAD '/user/daeho/words.txt' as (word);
numWords  = FOREACH (GROUP words ALL) GENERATE COUNT($1);
weight = FOREACH numWords GENERATE 1.0 / $0;
wordsWithWeight = CROSS words, weight;
sumWeight = FOREACH (GROUP wordsWithWeight ALL) GENERATE SUM($1.$1);
dump sumWeight;

sumWeight is not 1 even though words.txt has 118 lines.

Can we store floating point as binary format?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.