cecemei commented on code in PR #18722:
URL: https://github.com/apache/druid/pull/18722#discussion_r2611961650


##########
processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:
##########
@@ -1150,52 +1143,69 @@ private BaseColumnHolder readNestedFieldColumn(String 
field, int fieldIndex)
         );
         arrayElementBitmaps = GenericIndexed.read(
             dataBuffer,
-            bitmapSerdeFactory.getObjectStrategy(),
+            formatSpec.getBitmapEncoding().getObjectStrategy(),
             columnBuilder.getFileMapper()
         );
       } else {
         arrayElementDictionarySupplier = null;
         arrayElementBitmaps = null;
       }
-      final boolean hasNull = localDictionarySupplier.get().get(0) == 0;
-      Supplier<DictionaryEncodedColumn<?>> columnSupplier = () -> {
-        FixedIndexed<Integer> localDict = localDictionarySupplier.get();
-        return closer.register(new NestedFieldDictionaryEncodedColumn(
-            types,
-            longs.get(),
-            doubles.get(),
-            ints.get(),
-            stringDictionarySupplier.get(),
-            longDictionarySupplier.get(),
-            doubleDictionarySupplier.get(),
-            arrayDictionarySupplier != null ? arrayDictionarySupplier.get() : 
null,
-            localDict,
-            hasNull
-            ? rBitmaps.get(0)
-            : bitmapSerdeFactory.getBitmapFactory().makeEmptyImmutableBitmap()
-        ));
-      };
+      ColumnType theType = types.getSingleType();
+      BitmapIndexType indexType = (theType != null && theType.isNumeric())
+                                  ? 
formatSpec.getNumericFieldsBitmapIndexType()
+                                  : null;
       columnBuilder.setHasMultipleValues(false)
-                   .setHasNulls(hasNull)
-                   .setDictionaryEncodedColumnSupplier(columnSupplier);
-
-      columnBuilder.setIndexSupplier(
-          new NestedFieldColumnIndexSupplier(
-              types,
-              bitmapSerdeFactory.getBitmapFactory(),
-              columnConfig,
-              rBitmaps,
-              localDictionarySupplier,
-              stringDictionarySupplier,
-              longDictionarySupplier,
-              doubleDictionarySupplier,
-              arrayDictionarySupplier,
-              arrayElementDictionarySupplier,
-              arrayElementBitmaps
-          ),
-          true,
-          false
-      );
+                   .setType(theType != null
+                            ? theType
+                            : 
ColumnType.leastRestrictiveType(FieldTypeInfo.convertToSet(types.getByteValue())));
+      if (indexType != null && !(indexType instanceof 
BitmapIndexType.DictionaryEncodedValueIndex)) {
+        if (formatSpec.getNumericFieldsBitmapIndexType() instanceof 
BitmapIndexType.NullValueIndex) {
+          if (rBitmaps.size() != 1) {
+            throw DruidException.forPersona(DruidException.Persona.USER)
+                                
.ofCategory(DruidException.Category.INVALID_INPUT)
+                                .build(StringUtils.format(
+                                    "expecting 1 bitmap for %s type index, got 
[%d]",
+                                    indexType.toString(),
+                                    rBitmaps.size()
+                                ));
+          }

Review Comment:
   this is done



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