```
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 lock = lockParts();
    std::unordered_set<String> res;
    std::string_view prev_id;
    for (const auto & part : getDataPartsStateRange(DataPartState::Active))
    {
        if (prev_id == part->info.partition_id)
            continue;
        res.insert(part->info.partition_id);
        prev_id = part->info.partition_id;
    }
    return res;
}
MergeTreeData::DataPartsVector MergeTreeData::getDataPartsVectorForInternalUsage(