FrankChen021 commented on code in PR #19704:
URL: https://github.com/apache/druid/pull/19704#discussion_r3775307888
##########
processing/src/main/java/org/apache/druid/query/filter/TypedInFilter.java:
##########
@@ -277,6 +279,27 @@ public RangeSet<String> getDimensionRangeSet(String
dimension)
return retSet;
}
+ @Nullable
+ @Override
+ public TypedValueSet getDimensionValueSet(String dimension)
+ {
+ if (!Objects.equals(getColumn(), dimension)) {
+ return null;
+ }
+ // Only LONG is safe (identical stringification on ingest and query);
DOUBLE/FLOAT are excluded and STRING is
+ // handled by getDimensionRangeSet.
+ if (!matchValueType.is(ValueType.LONG)) {
+ return null;
+ }
+ // sortedMatchValues is coerced to matchValueType, so Evals.asString
yields the same canonical strings as ingest.
+ // A null element is kept as a null set element so it matches a shard's
stamped null (missing value).
+ final Set<String> values = new HashSet<>();
+ for (Object value : sortedMatchValues.get()) {
+ values.add(Evals.asString(value));
Review Comment:
[P2] Canonicalize presorted LONG IN values
When `matchValueType=LONG` and `sortedMatchValues` contains a numeric value
such as `1.0`, this loop stores `"1.0"`, while the existing LONG matcher
coerces the same input to `1`. A stamped segment recording `"1"` can then be
incorrectly pruned by typed segment pruning. Normalize LONG values with the
existing LONG coercion before constructing `TypedValueSet`, and add a
regression test.
--
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]