clintropolis commented on code in PR #13803:
URL: https://github.com/apache/druid/pull/13803#discussion_r1146906622
##########
processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:
##########
@@ -327,17 +390,58 @@ public void close()
}
@Override
- public DimensionSelector makeDimensionSelector(List<NestedPathPart> path,
ReadableOffset readableOffset, ExtractionFn fn)
+ public DimensionSelector makeDimensionSelector(
+ List<NestedPathPart> path,
+ ReadableOffset readableOffset,
+ ExtractionFn fn
+ )
{
final String field = getField(path);
Preconditions.checkNotNull(field, "Null field");
if (fields.indexOf(field) >= 0) {
DictionaryEncodedColumn<?> col = (DictionaryEncodedColumn<?>)
getColumnHolder(field).getColumn();
return col.makeDimensionSelector(readableOffset, fn);
- } else {
- return DimensionSelector.constant(null);
}
+ if (!path.isEmpty() && path.get(path.size() - 1) instanceof
NestedPathArrayElement) {
+ final NestedPathPart lastPath = path.get(path.size() - 1);
+ final String arrayField = getField(path.subList(0, path.size() - 1));
+ if (fields.indexOf(arrayField) >= 0) {
Review Comment:
refactored to use `fieldIndex` after looking up once
--
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]