ClickHouse / ClickHouse/ClickHouse

Provide information in the response metada about whether max_rows_to_group_by was breached

Open
#72,900 0 comments 0 reactions 0 assignees View on GitHub
comp-aggregation external feature
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

**Company or project name**

Sentry

**Use case**

We use `group_by_overflow_mode='any'` in combination with `max_rows_to_groupby` to avoid OOMs on high cardinality groupbys. At the moment, whether `max_rows_to_group_by` was actually breached is captured in the `ProfileEvents` [table](https://github.com/ClickHouse/ClickHouse/blob/777b016d6a2867cc8cfc5c8762b1a6a8d036aedf/src/Interpreters/Aggregator.cpp#L1791-L1817)

As a user, I would like to have this information reported to me in the metada such that I know that my results may not be entirely accurate (especially if I'm ordering by the results of the aggregation).

**Describe the solution you'd like**

The response metadata has a flag like `max_row_to_group_by_exceeded=true` which signals this information.

**Describe alternatives you've considered**

I've tried to use `WITH TOTALS` to calculate this but I would need to be able to use `totals_mode='after_having_inclusive'` and `totals_mode='after_having_exclusive'` in the same query to be able to compare them

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.