hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pradeep Kamath (JIRA)" <j...@apache.org>
Subject [jira] Created: (PIG-332) Comparing float column with double constant fails
Date Wed, 23 Jul 2008 00:15:31 GMT
Comparing float column with double constant fails

                 Key: PIG-332
                 URL: https://issues.apache.org/jira/browse/PIG-332
             Project: Pig
          Issue Type: Bug
    Affects Versions: types_branch
            Reporter: Pradeep Kamath
            Priority: Minor
             Fix For: types_branch

Script :

a = load '/user/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name:chararray,
age:int, gpa:float);
b = filter a by  name == 'fred allen' and age == 61 and gpa == 1.42;
store b into '/user/pig/tests/results/FilterEq_7.out' using PigStorage;

Result has 0 rows when infact there should be 1 row.

The reason is within Pig code in POCast, we do 
res.result = new Double(((Float)res.result).doubleValue());

to promote the column to a double. As a results of the above code, the precisions don't match
and hence the filter throws away the row.

This could be treated as "Working as designed" and the user may need to explicity do gpa ==
1.42f - just wanted it to be discussed and pointed out in the 2.0 release notes.

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

View raw message