hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daeho Baek (JIRA)" <j...@apache.org>
Subject [jira] Created: (PIG-82) Loose floating point precision
Date Wed, 30 Jan 2008 21:17:33 GMT
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.


Mime
View raw message