```
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;
```
MutableDataPartsVector & duplicate_parts_to_remove,
    MutableDataPartsVector & parts_from_wal)
{
    for (auto & part : parts_from_wal)
    {
        part->modification_time = time(nullptr);
        
        part->setState(DataPartState::Active);
        auto [it, inserted] = data_parts_indexes.insert(part);
        if (!inserted)
        {
            if ((*it)->checksums.getTotalChecksumHex() == part->checksums.getTotalChecksumHex())
            {
                LOG_ERROR(log, "Remove duplicate part {}", part->getDataPartStorage().getFullPath());
                duplicate_parts_to_remove.push_back(part);
            }
            else
                throw Exception("Part " + part->name + " already exists but with different checksums", ErrorCodes::DUPLICATE_DATA_PART);
        }
        addPartContributionToDataVolume(part);
    }
}
void MergeTreeData::loadDataParts(bool skip_sanity_checks)
{