Source:
public QueryableIndex loadIndex(List<ColumnHandle> columnHandles) throws IOException { ByteBuffer indexBuffer = ByteBuffer.wrap(segmentColumnSource.getColumnData(INDEX_METADATA_FILE_NAME)); final GenericIndexed<String> allColumns = GenericIndexed.read( indexBuffer, STRING_STRATEGY); GenericIndexed<String> allDimensions = GenericIndexed.read( indexBuffer, STRING_STRATEGY); Interval dataInterval = Intervals.utc(indexBuffer.getLong(), indexBuffer.getLong()); BitmapSerdeFactory segmentBitmapSerdeFactory; if (indexBuffer.hasRemaining()) { segmentBitmapSerdeFactory = JSON_MAPPER.readValue(SERIALIZER_UTILS.readString(indexBuffer), BitmapSerdeFactory.class); } else { segmentBitmapSerdeFactory = new BitmapSerde.LegacyBitmapSerdeFactory(); } Metadata metadata = null; ByteBuffer metadataBB = ByteBuffer.wrap(segmentColumnSource.getColumnData(SEGMENT_METADATA_FILE_NAME)); try { metadata = JSON_MAPPER.readValue(SERIALIZER_UTILS.readBytes(metadataBB, metadataBB.remaining()), Metadata.class); } catch (JsonParseException | JsonMappingException e) { log.warn(e, "Failed to load metadata for segment "); } Map<String, Supplier<ColumnHolder>> columns = new HashMap<>(); for (ColumnHandle columnHandle : columnHandles) { String columnName = ((DruidColumnHandle) columnHandle).getColumnName(); columns.put(columnName, () -> createColumnHolder(columnName)); } List<String> availableDimensions = Streams.stream(allDimensions.iterator()) .filter(dimension -> columns.containsKey(dimension)) .collect(toImmutableList()); columns.put(TIME_COLUMN_NAME, () -> createColumnHolder(TIME_COLUMN_NAME)); return new SimpleQueryableIndex( dataInterval, GenericIndexed.fromIterable(availableDimensions, STRING_STRATEGY), segmentBitmapSerdeFactory.getBitmapFactory(), columns, null, metadata, false); }

Target:
public QueryableIndex loadIndex(List<ColumnHandle> columnHandles) throws IOException { ByteBuffer indexBuffer = ByteBuffer.wrap(segmentColumnSource.getColumnData(INDEX_METADATA_FILE_NAME)); GenericIndexed.read(indexBuffer, STRING_STRATEGY); GenericIndexed<String> allDimensions = GenericIndexed.read( indexBuffer, STRING_STRATEGY); Interval dataInterval = Intervals.utc(indexBuffer.getLong(), indexBuffer.getLong()); BitmapSerdeFactory segmentBitmapSerdeFactory; if (indexBuffer.hasRemaining()) { segmentBitmapSerdeFactory = JSON_MAPPER.readValue(SERIALIZER_UTILS.readString(indexBuffer), BitmapSerdeFactory.class); } else { segmentBitmapSerdeFactory = new BitmapSerde.LegacyBitmapSerdeFactory(); } Metadata metadata = null; ByteBuffer metadataBuffer = ByteBuffer.wrap(segmentColumnSource.getColumnData(SEGMENT_METADATA_FILE_NAME)); try { metadata = JSON_MAPPER.readValue(SERIALIZER_UTILS.readBytes(metadataBuffer, metadataBuffer.remaining()), Metadata.class); } catch (JsonParseException | JsonMappingException e) { log.warn(e, "Failed to load metadata for segment"); } Map<String, Supplier<ColumnHolder>> columns = new HashMap<>(); for (ColumnHandle columnHandle : columnHandles) { String columnName = ((DruidColumnHandle) columnHandle).getColumnName(); columns.put(columnName, () -> createColumnHolder(columnName)); } List<String> availableDimensions = Streams.stream(allDimensions.iterator()) .filter(columns::containsKey) .collect(toImmutableList()); columns.put(TIME_COLUMN_NAME, () -> createColumnHolder(TIME_COLUMN_NAME)); Indexed<String> indexed = new ListIndexed<>(availableDimensions); return new SimpleQueryableIndex( dataInterval, indexed, segmentBitmapSerdeFactory.getBitmapFactory(), columns, null, metadata, false); }