Jackie-Jiang commented on code in PR #19017:
URL: https://github.com/apache/pinot/pull/19017#discussion_r3627946321
##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/PercentileSmartTDigestAggregationFunction.java:
##########
@@ -265,30 +266,38 @@ public Object extractGroupByResult(GroupByResultHolder
groupByResultHolder, int
}
@Override
- public Object merge(Object intermediateResult1, Object intermediateResult2) {
+ @Nullable
+ public Object merge(@Nullable Object intermediateResult1, @Nullable Object
intermediateResult2) {
+ if (intermediateResult1 == null) {
+ return intermediateResult2;
+ }
+ if (intermediateResult2 == null) {
+ return intermediateResult1;
+ }
if (intermediateResult1 instanceof TDigest) {
Review Comment:
```suggestion
if (intermediateResult1 instanceof PercentileTDigestAccumulator) {
```
Same for the other one
##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/PercentileSmartTDigestAggregationFunction.java:
##########
@@ -309,6 +324,9 @@ public SerializedIntermediateResult
serializeIntermediateResult(Object o) {
@Override
public Object deserializeIntermediateResult(CustomObject customObject) {
+ if (customObject.getType() ==
ObjectSerDeUtils.ObjectType.TDigest.getValue()) {
Review Comment:
Should we directly change the `TDIGEST_SER_DE`? Or add a ser-de for the
accumulator?
--
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]