diff --git a/fe/fe-core/src/main/java/com/starrocks/catalog/FunctionSet.java b/fe/fe-core/src/main/java/com/starrocks/catalog/FunctionSet.java index 4eb829ab6937a..ccc4572894f93 100644 --- a/fe/fe-core/src/main/java/com/starrocks/catalog/FunctionSet.java +++ b/fe/fe-core/src/main/java/com/starrocks/catalog/FunctionSet.java @@ -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) @@ -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, @@ -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));