cecemei commented on code in PR #18589:
URL: https://github.com/apache/druid/pull/18589#discussion_r2412080523
##########
processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:
##########
@@ -329,29 +323,69 @@ public Object getRowValue(int rowNum)
return null;
}
- if (compressedRawColumn == null) {
+ if (compressedRawColumn == null && compressedRawColumnSupplier != null) {
compressedRawColumn = closer.register(compressedRawColumnSupplier.get());
}
- final ByteBuffer valueBuffer = compressedRawColumn.get(rowNum);
- return STRATEGY.fromByteBuffer(valueBuffer, valueBuffer.remaining());
+ if (compressedRawColumnSupplier != null) {
+ final ByteBuffer valueBuffer = compressedRawColumn.get(rowNum);
+ return STRATEGY.fromByteBuffer(valueBuffer, valueBuffer.remaining());
+ }
+
+ final List<StructuredDataBuilder.Element> elements =
getAllParsedBaseFields()
+ .stream()
+ .map(pair -> {
+ NestedFieldDictionaryEncodedColumn column =
(NestedFieldDictionaryEncodedColumn) getColumnHolder(
+ pair.lhs.fieldName,
+ pair.lhs.fieldIndex
+ ).getColumn();
+ return StructuredDataBuilder.Element.of(pair.rhs,
column.lookupObject(rowNum));
Review Comment:
thanks for the catch! seems like it's not covered by test, added test
coverage in `NestedDataColumnSupplierTest`
--
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]