clintropolis commented on code in PR #14014:
URL: https://github.com/apache/druid/pull/14014#discussion_r1155481059
##########
processing/src/main/java/org/apache/druid/segment/NestedDataColumnIndexer.java:
##########
@@ -251,31 +232,47 @@ public Class<StructuredData> classOfObject()
}
};
}
-
- @Override
- public ColumnCapabilities getColumnCapabilities()
+ private ColumnType getLogicalType()
{
if (fieldIndexers.size() == 1 &&
fieldIndexers.containsKey(NestedPathFinder.JSON_PATH_ROOT)) {
FieldIndexer rootField =
fieldIndexers.get(NestedPathFinder.JSON_PATH_ROOT);
- if (rootField.isSingleType()) {
- return ColumnCapabilitiesImpl.createDefault()
-
.setType(rootField.getTypes().getSingleType())
- .setHasNulls(hasNulls);
- }
+ ColumnType singleType = rootField.getTypes().getSingleType();
+ return singleType == null ? ColumnType.NESTED_DATA : singleType;
}
- return ColumnCapabilitiesImpl.createDefault()
- .setType(NestedDataComplexTypeSerde.TYPE)
- .setHasNulls(hasNulls);
+ return ColumnType.NESTED_DATA;
}
@Override
- public ColumnCapabilities getHandlerCapabilities()
+ public ColumnCapabilities getColumnCapabilities()
{
return ColumnCapabilitiesImpl.createDefault()
- .setType(NestedDataComplexTypeSerde.TYPE)
+ .setType(getLogicalType())
.setHasNulls(hasNulls);
}
+ @Override
+ public ColumnFormat getFormat()
+ {
+ return new NestedDataComplexTypeSerde.LegacyNestedColumnFormat();
Review Comment:
oversight, will make a static instance
--
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]