clintropolis commented on code in PR #15752:
URL: https://github.com/apache/druid/pull/15752#discussion_r1469157040


##########
processing/src/main/java/org/apache/druid/segment/nested/NestedFieldColumnIndexSupplier.java:
##########
@@ -1292,7 +1429,25 @@ private void findNext()
             {
               while (!nextSet && iterator.hasNext()) {
                 Integer nextValue = iterator.next();
-                if (nextValue >= adjustDoubleId) {
+                if (nextValue >= adjustArrayId) {
+                  // this shouldn't be possible since arrayIds will only exist 
if array dictionary is not null
+                  // v4 columns however have a null array dictionary
+                  Preconditions.checkNotNull(arrayDictionary);
+                  final int[] array = arrayDictionary.get(nextValue - 
adjustArrayId);
+                  final Object[] arrayObj = new Object[array.length];
+                  for (int i = 0; i < arrayObj.length; i++) {
+                    if (array[i] == 0) {
+                      arrayObj[i] = null;
+                    } else if (array[i] >= adjustDoubleId) {
+                      arrayObj[i] = doubleDictionary.get(array[i] - 
adjustDoubleId);
+                    } else if (array[i] >= adjustLongId) {
+                      arrayObj[i] = longDictionary.get(array[i] - 
adjustLongId);
+                    } else {
+                      arrayObj[i] = 
StringUtils.fromUtf8Nullable(stringDictionary.get(array[i]));
+                    }

Review Comment:
   this value lookup stuff is repeated in a bunch of places, will try to find a 
way to abstract it in a future PR so it can be shared better instead of repeated



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