clintropolis commented on code in PR #14542:
URL: https://github.com/apache/druid/pull/14542#discussion_r1264030646
##########
processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:
##########
@@ -310,6 +312,32 @@ public int lookupId(String val)
return -1;
}
+
+ public IntSet lookupIds(String val)
+ {
+ IntSet intList = new IntArraySet(3);
+ if (val == null) {
+ intList.add(0);
+ return intList;
+ }
+ int candidate =
stringDictionary.indexOf(StringUtils.toUtf8ByteBuffer(val));
+ if (candidate >= 0) {
+ intList.add(candidate);
+ }
+ candidate = longDictionary.indexOf(GuavaUtils.tryParseLong(val));
+ if (candidate >= 0) {
+ candidate += adjustLongId;
+ intList.add(candidate);
+ }
+ candidate = doubleDictionary.indexOf(Doubles.tryParse(val));
Review Comment:
we have this pattern in a few other places where we are trying to find the
index/indexes for some value, i just copied it, but yeah, can fix since only
the first dictionary can have null
--
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]