This is an automated email from the ASF dual-hosted git repository.
mayanks pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push:
new d283ba0 Modify `DistinctCountThetaSketch` to return LONG instead of
INT. (#5638)
d283ba0 is described below
commit d283ba0efbb283d5278a820750cfb7712eed4913
Author: Mayank Shrivastava <[email protected]>
AuthorDate: Mon Jun 29 22:24:43 2020 -0700
Modify `DistinctCountThetaSketch` to return LONG instead of INT. (#5638)
This seems to have been an oversight in the original implementation,
this aggregation should return LONG.
---
.../function/DistinctCountThetaSketchAggregationFunction.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
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 f8fd1ae..c89ed8f 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
@@ -55,7 +55,7 @@ import org.apache.pinot.sql.parsers.CalciteSqlParser;
* <p>TODO: For performance concern, use {@code List<Sketch>} as the
intermediate result.
*/
@SuppressWarnings("Duplicates")
-public class DistinctCountThetaSketchAggregationFunction implements
AggregationFunction<Map<String, Sketch>, Integer> {
+public class DistinctCountThetaSketchAggregationFunction implements
AggregationFunction<Map<String, Sketch>, Long> {
private final ExpressionContext _thetaSketchColumn;
private final ThetaSketchParams _thetaSketchParams;
private final SetOperationBuilder _setOperationBuilder;
@@ -441,13 +441,13 @@ public class DistinctCountThetaSketchAggregationFunction
implements AggregationF
@Override
public DataSchema.ColumnDataType getFinalResultColumnType() {
- return DataSchema.ColumnDataType.INT;
+ return DataSchema.ColumnDataType.LONG;
}
@Override
- public Integer extractFinalResult(Map<String, Sketch> intermediateResult) {
+ public Long extractFinalResult(Map<String, Sketch> intermediateResult) {
Sketch finalSketch = extractFinalSketch(intermediateResult);
- return (int) Math.round(finalSketch.getEstimate());
+ return Math.round(finalSketch.getEstimate());
}
private Predicate getPredicate(String predicateString) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]