jtuglu1 commented on code in PR #18879:
URL: https://github.com/apache/druid/pull/18879#discussion_r2658344166
##########
processing/src/main/java/org/apache/druid/segment/incremental/IncrementalIndex.java:
##########
@@ -1029,15 +1029,19 @@ public MetricDesc(int index, AggregatorFactory factory)
capabilities =
ColumnCapabilitiesImpl.createSimpleNumericColumnCapabilities(valueType);
this.type = valueType.toString();
} else if (valueType.is(ValueType.COMPLEX)) {
- capabilities = ColumnCapabilitiesImpl.createDefault()
- .setType(valueType)
-
.setHasNulls(ColumnCapabilities.Capable.TRUE);
ComplexMetricSerde serde =
ComplexMetrics.getSerdeForType(valueType.getComplexTypeName());
- if (serde != null) {
- this.type = serde.getTypeName();
- } else {
+ if (serde == null) {
throw new ISE("Unable to handle complex type[%s]", valueType);
}
+ this.type = serde.getTypeName();
+ // The serde's type name represents the canonical storage type (e.g.,
"HLLSketch"),
+ // while the aggregator's intermediate type may be more specific
(e.g., "HLLSketchBuild").
+ // Using the serde's type ensures that segment metadata queries return
consistent types
+ // across realtime (IncrementalIndex) and historical (QueryableIndex)
segments.
+ // See https://github.com/apache/druid/issues/14315.
Review Comment:
Yeah – I was going to look into this. I presume it's a similar story there,
I'll add another test.
--
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]