kgyrtkirk commented on code in PR #15012:
URL: https://github.com/apache/druid/pull/15012#discussion_r1330942408


##########
processing/src/main/java/org/apache/druid/query/dimension/ListFilteredDimensionSpec.java:
##########
@@ -92,15 +92,17 @@ public static IdMapping buildAllowListIdMapping(
       IndexedGetter<String> fn
   )
   {
-    final IdMapping.Builder builder = 
IdMapping.Builder.ofCardinality(values.size());
+    IdMapping.Builder builder;
     if (idLookup != null) {
+      builder = IdMapping.Builder.ofCardinality(values.size());
       for (String value : values) {
         int i = idLookup.lookupId(value);
         if (i >= 0) {
           builder.addMapping(i);
         }
       }
     } else {
+      builder = IdMapping.Builder.ofCardinality(cardinality);

Review Comment:
   I didn't wanted to change that class - but it makes sense to do so.
   
   with auto-growing available this second branch doesn't cause any issues; so 
I've undone the changes to this part.
   
   btw: I'm wondering in case it reports 1-to-1 - wouldn't that still map 
unknown values to `null` ? ...so if there is a `null` in the input `values` it 
could still have more matches - but anyway this will work correctly with the 
current approach



-- 
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]

Reply via email to