Anas Saiyed
06/18/2026, 11:03 PMERROR 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.Евгений Шишкин
06/18/2026, 11:07 PMAnas Saiyed
06/18/2026, 11:08 PMAnas Saiyed
06/19/2026, 12:01 AM