Calculates the approximate number of different values of the argument.
The function takes a variable number of parameters. Parameters can be
String, or numeric types.
- A UInt64-type number.
Calculates a hash for all parameters in the aggregate, then uses it in calculations.
Uses an adaptive sampling algorithm. For the calculation state, the function uses a sample of element hash values up to 65536. This algorithm is very accurate and very efficient on the CPU. When the query contains several of these functions, using
uniqis almost as fast as using other aggregate functions.
Provides the result deterministically (it does not depend on the query processing order).
We recommend using this function in almost all scenarios.