clintropolis commented on code in PR #19023:
URL: https://github.com/apache/druid/pull/19023#discussion_r2820328257
##########
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:
ah they probably could use a shared method, i could measure just to be sure;
this sort of code is copied in a lot of places all across the nested column
stuff since quite a lot of places have to do a similar translation from local
field ids to global ids, i had a dream that someday i would try to consolidate
them, but haven't really got around to it yet 😅
--
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]