anyHeavy
Selects a frequently occurring value using the heavy hitters algorithm. If there is a value that occurs more than in half the cases in each of the query’s execution threads, this value is returned.
Danger
The result of this function is non-deterministic. Using it with aggregates can lead to unpredictable results and is generally not recommended.
anyHeavy(column)
Arguments
column– The column name.
Example
Take the OnTime data set and select any frequently occurring value in the AirlineID column.
SELECT anyHeavy(AirlineID) AS res
FROM ontime
┌───res─┐
│ 19690 │
└───────┘