capistrant commented on code in PR #19023:
URL: https://github.com/apache/druid/pull/19023#discussion_r2818901833
##########
processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:
##########
@@ -385,6 +385,33 @@ public BitmapFactory getBitmapFactory()
return bitmapFactory;
}
+ @Override
+ public Iterator<String> getValueIterator()
+ {
+ final Iterator<Integer> localIterator = localDictionary.iterator();
+ return new Iterator<>()
+ {
+ @Override
+ public boolean hasNext()
+ {
+ return localIterator.hasNext();
+ }
+
+ @Override
+ public String next()
+ {
+ int globalIndex = localIterator.next();
+ if (globalIndex < adjustLongId) {
+ return
StringUtils.fromUtf8Nullable(stringDictionary.get(globalIndex));
+ } else if (globalIndex < adjustDoubleId) {
+ return String.valueOf(longDictionary.get(globalIndex -
adjustLongId));
+ } else {
+ return String.valueOf(doubleDictionary.get(globalIndex -
adjustDoubleId));
+ }
Review Comment:
as this logic is the same as `getValue` is there sense in having something
like `private String getUsingGlobalIndex(int index)` that both can share? I'm
not as used to the hot query path though, would that risk perf or would the
compiler inline it and result in no runtime difference?
--
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]