Skip to content

Commit

Permalink
fix AggStateCombinatorTest fault
Browse files Browse the repository at this point in the history
Signed-off-by: chenminghua8 <[email protected]>
  • Loading branch information
chenminghua8 committed Nov 25, 2024
1 parent 6aff6a7 commit c573071
Showing 1 changed file with 17 additions and 29 deletions.
46 changes: 17 additions & 29 deletions fe/fe-core/src/main/java/com/starrocks/catalog/FunctionSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,6 @@ public class FunctionSet {
.add(INTERSECT_COUNT)
.add(LC_PERCENTILE_DISC)
.add(MAP_AGG)
.add(DS_HLL_COUNT_DISTINCT)
.add(DS_QUANTILE)
.add(DS_FREQUENT)
.add(DS_THETA)
Expand Down Expand Up @@ -1135,6 +1134,23 @@ private void initAggregateBuiltins() {
Lists.newArrayList(t), Type.BIGINT, Type.VARBINARY,
true, false, true));

// ds_hll_count_distinct(col)
addBuiltin(AggregateFunction.createBuiltin(DS_HLL_COUNT_DISTINCT,
Lists.newArrayList(t), Type.BIGINT, Type.VARBINARY,
true, false, true));
// ds_hll_count_distinct(col, log_k)
addBuiltin(AggregateFunction.createBuiltin(DS_HLL_COUNT_DISTINCT,
Lists.newArrayList(t, Type.INT), Type.BIGINT, Type.VARBINARY,
true, false, true));
// ds_hll_count_distinct(col, log_k, tgt_type)
addBuiltin(AggregateFunction.createBuiltin(DS_HLL_COUNT_DISTINCT,
Lists.newArrayList(t, Type.INT, Type.VARCHAR), Type.BIGINT, Type.VARBINARY,
true, false, true));
// ds_theta(col)
addBuiltin(AggregateFunction.createBuiltin(DS_THETA,
Lists.newArrayList(t), Type.BIGINT, Type.VARBINARY,
true, false, true));

// HLL_RAW
addBuiltin(AggregateFunction.createBuiltin(HLL_RAW,
Lists.newArrayList(t), Type.HLL, Type.VARBINARY,
Expand Down Expand Up @@ -1600,34 +1616,6 @@ private void registerBuiltinApproxTopKWindowFunction() {
}

private void registerBuiltinDsFunction() {
for (Type t : Type.getSupportedTypes()) {
if (t.isFunctionType()) {
continue;
}
if (t.isNull()) {
continue; // NULL is handled through type promotion.
}
if (t.isChar()) {
continue; // promoted to STRING
}
// ds_hll_count_distinct(col)
addBuiltin(AggregateFunction.createBuiltin(DS_HLL_COUNT_DISTINCT,
Lists.newArrayList(t), Type.BIGINT, Type.VARBINARY,
true, false, true));
// ds_hll_count_distinct(col, log_k)
addBuiltin(AggregateFunction.createBuiltin(DS_HLL_COUNT_DISTINCT,
Lists.newArrayList(t, Type.INT), Type.BIGINT, Type.VARBINARY,
true, false, true));
// ds_hll_count_distinct(col, log_k, tgt_type)
addBuiltin(AggregateFunction.createBuiltin(DS_HLL_COUNT_DISTINCT,
Lists.newArrayList(t, Type.INT, Type.VARCHAR), Type.BIGINT, Type.VARBINARY,
true, false, true));
// ds_theta(col)
addBuiltin(AggregateFunction.createBuiltin(DS_THETA,
Lists.newArrayList(t), Type.BIGINT, Type.VARBINARY,
true, false, true));
}

addBuiltin(AggregateFunction.createBuiltin(DS_QUANTILE,
Lists.newArrayList(Type.DOUBLE), Type.ARRAY_DOUBLE, Type.VARBINARY,
false, false, true));
Expand Down

0 comments on commit c573071

Please sign in to comment.