You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/01/12 10:34:18 UTC

[GitHub] [incubator-doris] xinyiZzz opened a new pull request #5226: [Bug] Fix row_number and group by have inconsistent partition results for (0.0, -0.0)

xinyiZzz opened a new pull request #5226:
URL: https://github.com/apache/incubator-doris/pull/5226


   ## Proposed changes
   
   ####problem analysis
   The essence of the problem is negative zero (-0.0) and positive zero (+0.0) compared with different results. C++ defaults -0 == 0 return truem. To unify the eq relationship of -0 and 0 in Doris, modified to -0 == 0 return false.
   
   ####Change location
   1. Compare whether two double values ​​are equal in BinaryPredicate
   2. Overloaded operator== operator in DoubleVal
   
   ####The remaining problems
   1. When order by is still considered equal to 0.0 and -0.0, the order of 0.0 and -0.0 in the result is random
   2. Floating point arithmetic in C++ is often IEEE-754. This norm defines two different representations for the value zero: positive zero and negative zero. It is also defined that those two representations must compare equals. So A better way is to unify the eq relationship of -0 and 0 as true.
   
   ref: https://stackoverflow.com/questions/45795397
   ref: https://www.johndcook.com/blog/2010/06/15/why-computers-have-signed-zero/
   
   ## Types of changes
   
   - [x] Bugfix (non-breaking change which fixes an issue)
   
   ## Checklist
   
   - [x] I have create an issue on (Fix #5225), and have described the bug/feature there in detail
   - [x] Compiling and unit tests pass locally with my changes


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman merged pull request #5226: [Bug] Fix row_number and group by have inconsistent partition results for (0.0, -0.0)

Posted by GitBox <gi...@apache.org>.
morningman merged pull request #5226:
URL: https://github.com/apache/incubator-doris/pull/5226


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org