nozjkoitop commented on code in PR #18250:
URL: https://github.com/apache/druid/pull/18250#discussion_r2215270883
##########
processing/src/main/java/org/apache/druid/query/filter/RangeFilter.java:
##########
@@ -926,10 +950,25 @@ public static DruidDoublePredicate makeDoublePredicate(
return DruidPredicateMatch.of((lowerComparing >= 0) &&
(upperComparing > 0));
};
case CLOSED:
+ if (Double.compare(lowerDoubleBound, upperDoubleBound) == 0) {
+ final long dblBits = Double.doubleToLongBits(lowerDoubleBound);
+ final int fltBits = Float.floatToIntBits((float) lowerDoubleBound);
+
+ return input -> {
+ long inDblBits = Double.doubleToLongBits(input);
+ if (inDblBits == dblBits) {
+ return DruidPredicateMatch.TRUE;
+ }
+ return DruidPredicateMatch.of(
+ Float.floatToIntBits((float) input) == fltBits
+ );
Review Comment:
The idea is to check the inDblBits == dblBits before, and fallback to the
float casting, however it brings up the problem with false positive results for
a really precise doubles.
The other solution i see atm, is to try creating a separate flow for the
floats
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]