abhioncbr commented on issue #10686: URL: https://github.com/apache/pinot/issues/10686#issuecomment-1526229372
> Losing precision might not be the root cause though. Even if we do float to double casting, the number won't match. > > ``` > System.out.println((double) 1.1f); --> 1.100000023841858 > ``` > > Which query is giving different result comparing to H2? Well, you are following the wrong order of casting. The problematic comparison involves casting from `double -> float`. ``` System.out.println((double) 1.1f); --> 1.100000023841858 (correct) System.out.println((float) 1.1d); --> 1.1 (incorrect) // incorrect float/double comparison because of casting float f = 1.1f; double d = 1.1d; System.out.println(Float.compare(f, (float)d)); --> 0 (Such comparison in Pinot resulting incorrect output) ``` We are ignoring the [following queries in our test cases](https://github.com/apache/pinot/blob/master/pinot-query-runtime/src/test/resources/queries/Comparisons.json#L346) -- 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. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org