xiangfu0 commented on code in PR #19015:
URL: https://github.com/apache/pinot/pull/19015#discussion_r3619771423


##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/PercentileRawTDigestAggregationFunction.java:
##########
@@ -147,6 +147,10 @@ public ColumnDataType getFinalResultColumnType() {
 
   @Override
   public SerializedTDigest extractFinalResult(TDigest intermediateResult) {
+    if (intermediateResult instanceof PercentileTDigestAccumulator) {

Review Comment:
   Yes — it was a real bug on current master (t-digest 3.2): a 
capacity-preserving accumulator (e.g. a small-encoded digest with more 
centroids than a fresh `MergingDigest` of that compression allocates, from a 
pre-aggregated BYTES column) got re-encoded by the generic serde into verbose 
bytes that any plain reader rejects with `ArrayIndexOutOfBoundsException`. 
Split into #19017 with a root-cause fix (accumulator overrides 
`byteSize()`/`asBytes()` to emit `serialize()` bytes polymorphically), so this 
call-site change is no longer needed and is gone from this PR after rebasing on 
#19017.



##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/PercentileSmartTDigestAggregationFunction.java:
##########
@@ -184,7 +184,7 @@ private void aggregateIntoValueList(int length, 
AggregationResultHolder aggregat
   }
 
   private TDigest convertValueListToTDigest(DoubleArrayList valueList) {
-    TDigest tDigest = TDigest.createMergingDigest(_compression);
+    TDigest tDigest = new PercentileTDigestAccumulator(_compression);

Review Comment:
   Correct — the Smart function missed the accumulator routing in #18996. Moved 
to #19017 together with the serialization fix; this PR is now rebased on top 
and no longer touches this file.



-- 
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]

Reply via email to