ClickHouse/docs/zh/sql-reference/aggregate-functions/reference/anyheavy.md
Robert Schulze fa93952231
Docs: Reference external papers as DOIs
See also #31076 which noted that links were broken but didn't fix.
2022-09-28 12:21:58 +00:00

36 lines
748 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
slug: /zh/sql-reference/aggregate-functions/reference/anyheavy
sidebar_position: 103
---
# anyHeavy {#anyheavyx}
选择一个频繁出现的值,使用[heavy hitters](https://doi.org/10.1145/762471.762473) 算法。 如果某个值在查询的每个执行线程中出现的情况超过一半,则返回此值。 通常情况下,结果是不确定的。
``` sql
anyHeavy(column)
```
**参数**
- `column` The column name。
**示例**
使用 [OnTime](../../../getting-started/example-datasets/ontime.md) 数据集,并选择在 `AirlineID` 列任何频繁出现的值。
查询:
``` sql
SELECT anyHeavy(AirlineID) AS res
FROM ontime;
```
结果:
``` text
┌───res─┐
│ 19690 │
└───────┘
```