StarRocks does not support <approx_count_distinct>...
# questions-and-troubleshooting
a
StarRocks does not support approx_count_distinct for array type columns. Here's the error I get.
Copy code
ERROR 1064 (HY000): Getting analyzing error from line 1, column 193 to line 1, column 218. Detail message: No matching function with signature: approx_count_distinct(array<varchar>).
Would it be possible to implement this feature? It looks like this is a type-gating choice rather than a fundamental limitation: • HLL only needs a hashable input, and count(distinct array_col) already proves arrays are hashable/comparable for distinctness — so feeding those values into the sketch should be viable. • 3.5 already added NDV statistics collection for ARRAY columns, so the engine seemingly computes approximate array distinct-counts internally for the optimizer; it just isn't exposed as a callable function. • The blockers we found are (1) no registered approx_count_distinct(array<…>) signature and (2) the canApplyToNumeric() || isBinaryType() guard in FunctionAnalyzer, which excludes complex types. Semantics would naturally match count(distinct) — counting distinct whole array values.
е
maybe file a feature request on github
a
Will do. Thanks!