[ 
https://issues.apache.org/jira/browse/BEAM-10462?focusedWorklogId=459566&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-459566
 ]

ASF GitHub Bot logged work on BEAM-10462:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Jul/20 22:58
            Start Date: 15/Jul/20 22:58
    Worklog Time Spent: 10m 
      Work Description: apilloud merged pull request #12240:
URL: https://github.com/apache/beam/pull/12240


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 459566)
    Time Spent: 1.5h  (was: 1h 20m)

> org.apache.beam.sdk.transforms corrupt data when a value is Double.NaN
> ----------------------------------------------------------------------
>
>                 Key: BEAM-10462
>                 URL: https://issues.apache.org/jira/browse/BEAM-10462
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>    Affects Versions: 0.2.0-incubating, 2.22.0
>            Reporter: Andrew Pilloud
>            Assignee: Andrew Pilloud
>            Priority: P1
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> When there is a NaN value in the PCollection passed into Min or Max we get a 
> random value back due to the way the CombineFn works. Per the SQL standard, 
> we should always get NaN back. I'm going to add a special case get the right 
> answer.
> Looks like we switched from using Double.compare to `>=` operator in 
> https://github.com/apache/beam/commit/21a5b44c3b541ba6c89df5649afe00412df73d10,
>  which introduced a data corruption bug.
> A test case demonstrating this issue:
> {code}
>   @Test
>   public void testDouble() {
>     Assert.assertFalse(Double.NaN >= 0.9);
>     Assert.assertFalse(0.9 >= Double.NaN);
>     Assert.assertFalse(Double.NaN >= Double.POSITIVE_INFINITY);
>     Assert.assertFalse(Double.POSITIVE_INFINITY >= Double.NaN);
>     Assert.assertTrue(Double.compare(Double.NaN, 0.9) >= 0);
>     Assert.assertFalse(Double.compare(0.9, Double.NaN) >= 0);
>     Assert.assertTrue(Double.compare(Double.NaN, Double.POSITIVE_INFINITY) >= 
> 0);
>     Assert.assertFalse(Double.compare(Double.POSITIVE_INFINITY, Double.NaN) 
> >= 0);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to