```
CREATE TABLE t (x UInt8, PROJECTION p (SELECT x GROUP BY x)) ENGINE = MergeTree ORDER BY ();
INSERT INTO t VALUES (0);

SET group_by_overflow_mode = 'any', max_rows_to_group_by = 1000, totals_mode = 'after_having_auto';
SELECT x FROM t GROUP BY x WITH TOTALS;
```
auto it = projections.find(candidate.desc->name);
        if (it != projections.end())
            projection_parts.push_back(it->second);
        else
            normal_parts.push_back(part);
    }
    if (projection_parts.empty())
        return;
    auto projection_result_ptr = reader.estimateNumMarksToRead(
        projection_parts,
        candidate.prewhere_info,
        candidate.required_columns,
        storage_snapshot->metadata,
        candidate.desc->metadata,
        query_info,
        added_filter_nodes,
        query_context,
        settings.max_threads,
        max_added_blocks);
    if (projection_result_ptr->error())
        return;
    auto sum_marks = projection_result_ptr->marks();
    if (normal_parts.empty())
    {
        
        
        candidate.complete = true;
    }
    else
    {