hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olga Natkovich (JIRA)" <j...@apache.org>
Subject [jira] Updated: (PIG-332) Comparing float column with double constant fails
Date Fri, 12 Sep 2008 00:37:44 GMT

     [ https://issues.apache.org/jira/browse/PIG-332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Olga Natkovich updated PIG-332:
-------------------------------

    Priority: Minor  (was: Major)

This just needs to be documented

> 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 :
> {code}
> 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;
> {code}
> Result has 0 rows when infact there should be 1 row.
> The reason is within Pig code in POCast, we do 
> {code}
> res.result = new Double(((Float)res.result).doubleValue());
> {code}
> 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.


Mime
View raw message