```
presto> select approx_distinct(false);
Query 20181113_204447_00000_agpdr failed: Unsupported type parameters (BoundVariables{typeVariables={T=boolean}, longVariables={}}) for approx_distinct
Is it bad error message? Or, maybe, approx_distinct(boolean) could be supported?
We could certainly support it for completeness, but it’s a little nonsensical. The “approx” part of the function is to deal with large cardinalities within a limited memory budget. For booleans, it’s trivial to do it exactly and with constant memory, so the “approx” notion would be misleading.
I am aware. I am thinking about the case where someone generates approx_distinct(column) for every column in a table (for some reason).
Then adding approx_distinct support for booleans (which should in fact be exact) makes some sense.
Raised a PR https://github.com/prestodb/presto/pull/12209
Most helpful comment
I am aware. I am thinking about the case where someone generates
approx_distinct(column)for every column in a table (for some reason).Then adding
approx_distinctsupport for booleans (which should in fact be exact) makes some sense.