ClickHouse distributed GROUP BY partial results under timeout_overflow_mode break
0 reputation · 04 May 2020, 19:38 UTC
Goal
I need to return partial aggregation results from a ClickHouse distributed GROUP BY query when execution exceeds max_execution_time, using timeout_overflow_mode='break' so the coordinator stops the query instead of throwing.
Constraint
Cancellation is propagated to remote shards asynchronously, and some shards may finish aggregation while others are interrupted mid-aggregation. ClickHouse does not document a deterministic merge rule for these partial aggregates, so result consistency across repeated runs is uncertain.
Questions
- Does ClickHouse guarantee deterministic merging of partial
GROUP BYresults whentimeout_overflow_mode='break'interrupts shards unevenly? - Is this behavior stable in ClickHouse 23.x and later, or should it be treated as experimental and avoided for correctness-critical workloads?