You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ja...@apache.org on 2023/06/16 22:49:35 UTC

[pinot] branch master updated: Upgrade to Apache Datasketches 4.0.0 (#10878)

This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 9a1795c2b0 Upgrade to Apache Datasketches 4.0.0 (#10878)
9a1795c2b0 is described below

commit 9a1795c2b0e3e60b04c3d0e06bfde6d11563aa82
Author: David Cromberge <da...@gmail.com>
AuthorDate: Fri Jun 16 23:49:29 2023 +0100

    Upgrade to Apache Datasketches 4.0.0 (#10878)
---
 .../function/AvgValueIntegerTupleSketchAggregationFunction.java       | 4 ++--
 .../function/DistinctCountThetaSketchAggregationFunction.java         | 4 ++--
 .../function/SumValuesIntegerTupleSketchAggregationFunction.java      | 4 ++--
 pom.xml                                                               | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/AvgValueIntegerTupleSketchAggregationFunction.java b/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/AvgValueIntegerTupleSketchAggregationFunction.java
index 7ef6633619..3b3718dba2 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/AvgValueIntegerTupleSketchAggregationFunction.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/AvgValueIntegerTupleSketchAggregationFunction.java
@@ -20,7 +20,7 @@ package org.apache.pinot.core.query.aggregation.function;
 
 import java.util.List;
 import org.apache.datasketches.tuple.CompactSketch;
-import org.apache.datasketches.tuple.SketchIterator;
+import org.apache.datasketches.tuple.TupleSketchIterator;
 import org.apache.datasketches.tuple.Union;
 import org.apache.datasketches.tuple.aninteger.IntegerSummary;
 import org.apache.pinot.common.request.context.ExpressionContext;
@@ -56,7 +56,7 @@ public class AvgValueIntegerTupleSketchAggregationFunction
     integerSummarySketches.forEach(union::union);
     double retainedTotal = 0L;
     CompactSketch<IntegerSummary> result = union.getResult();
-    SketchIterator<IntegerSummary> summaries = result.iterator();
+    TupleSketchIterator<IntegerSummary> summaries = result.iterator();
     while (summaries.next()) {
       retainedTotal += summaries.getSummary().getValue();
     }
diff --git a/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/DistinctCountThetaSketchAggregationFunction.java b/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/DistinctCountThetaSketchAggregationFunction.java
index 528e42a559..c6a57b373f 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/DistinctCountThetaSketchAggregationFunction.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/DistinctCountThetaSketchAggregationFunction.java
@@ -25,7 +25,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.datasketches.Util;
 import org.apache.datasketches.memory.Memory;
 import org.apache.datasketches.theta.AnotB;
 import org.apache.datasketches.theta.Intersection;
@@ -34,6 +33,7 @@ import org.apache.datasketches.theta.Sketch;
 import org.apache.datasketches.theta.Union;
 import org.apache.datasketches.theta.UpdateSketch;
 import org.apache.datasketches.theta.UpdateSketchBuilder;
+import org.apache.datasketches.thetacommon.ThetaUtil;
 import org.apache.pinot.common.request.Expression;
 import org.apache.pinot.common.request.context.ExpressionContext;
 import org.apache.pinot.common.request.context.FilterContext;
@@ -1305,7 +1305,7 @@ public class DistinctCountThetaSketchAggregationFunction
     private static final char PARAMETER_KEY_VALUE_SEPARATOR = '=';
     private static final String NOMINAL_ENTRIES_KEY = "nominalEntries";
 
-    private int _nominalEntries = Util.DEFAULT_NOMINAL_ENTRIES;
+    private int _nominalEntries = ThetaUtil.DEFAULT_NOMINAL_ENTRIES;
 
     Parameters(String parametersString) {
       StringUtils.deleteWhitespace(parametersString);
diff --git a/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/SumValuesIntegerTupleSketchAggregationFunction.java b/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/SumValuesIntegerTupleSketchAggregationFunction.java
index 0167c7a0cf..33f746a1da 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/SumValuesIntegerTupleSketchAggregationFunction.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/SumValuesIntegerTupleSketchAggregationFunction.java
@@ -20,7 +20,7 @@ package org.apache.pinot.core.query.aggregation.function;
 
 import java.util.List;
 import org.apache.datasketches.tuple.CompactSketch;
-import org.apache.datasketches.tuple.SketchIterator;
+import org.apache.datasketches.tuple.TupleSketchIterator;
 import org.apache.datasketches.tuple.Union;
 import org.apache.datasketches.tuple.aninteger.IntegerSummary;
 import org.apache.pinot.common.request.context.ExpressionContext;
@@ -54,7 +54,7 @@ public class SumValuesIntegerTupleSketchAggregationFunction extends IntegerTuple
     integerSummarySketches.forEach(union::union);
     double retainedTotal = 0L;
     CompactSketch<IntegerSummary> result = union.getResult();
-    SketchIterator<IntegerSummary> summaries = result.iterator();
+    TupleSketchIterator<IntegerSummary> summaries = result.iterator();
     while (summaries.next()) {
       retainedTotal += summaries.getSummary().getValue();
     }
diff --git a/pom.xml b/pom.xml
index 80a1fdc0fe..fb064e541b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -900,7 +900,7 @@
       <dependency>
         <groupId>org.apache.datasketches</groupId>
         <artifactId>datasketches-java</artifactId>
-        <version>3.3.0</version>
+        <version>4.0.0</version>
       </dependency>
       <dependency>
         <groupId>com.tdunning</groupId>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org