You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "kgyrtkirk (via GitHub)" <gi...@apache.org> on 2025/07/17 15:10:48 UTC
Re: [PR] Fix range filter inconsistency (druid)
kgyrtkirk commented on code in PR #18250:
URL: https://github.com/apache/druid/pull/18250#discussion_r2213625705
##########
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:
does this mean that if `(Double.compare(lowerDoubleBound, upperDoubleBound) == 0` is satisfied ; the predicates is weakened down to `float` level even when `input` is a `double` ?
cc: @clintropolis
--
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-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org