Jackie-Jiang commented on code in PR #17284:
URL: https://github.com/apache/pinot/pull/17284#discussion_r2578526494


##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/array/SumArrayDoubleAggregationFunction.java:
##########
@@ -138,7 +138,7 @@ public DoubleArrayList merge(DoubleArrayList 
intermediateResult1, DoubleArrayLis
 
   @Override
   public DataSchema.ColumnDataType getIntermediateResultColumnType() {
-    return DataSchema.ColumnDataType.DOUBLE_ARRAY;
+    return DataSchema.ColumnDataType.OBJECT;

Review Comment:
   Why do we need to change this?



##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/StUnionAggregationFunction.java:
##########
@@ -136,4 +137,18 @@ public DataSchema.ColumnDataType 
getFinalResultColumnType() {
   public ByteArray extractFinalResult(Geometry geometry) {
     return new ByteArray(GeometrySerializer.serialize(geometry));
   }
+
+  private static Geometry union(Geometry left, Geometry right) {

Review Comment:
   Add `@Nullable` annotation when applicable



##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/DistinctCountULLAggregationFunction.java:
##########
@@ -309,7 +314,12 @@ public void aggregateGroupByMV(int length, int[][] 
groupKeysArray, GroupByResult
   public UltraLogLog extractAggregationResult(AggregationResultHolder 
aggregationResultHolder) {
     Object result = aggregationResultHolder.getResult();
     if (result == null) {
-      return UltraLogLog.create(_p);
+      if (_aggregateOnRawValues) {
+        return UltraLogLog.create(_p);
+      }
+      // Here we cannot directly return a default UltraLogLog object, as if 
the input is ULL bytes, which may use a
+      // different _p, then the ULL object merge will fail.
+      return null;

Review Comment:
   Can we always return `null`? Return `null` conditionally can still cause 
problems, e.g. when consuming segment aggregates on raw values, while sealed 
segments aggregate on pre-aggregated values



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