```
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;
```
quoteString(src_part->getDataPartStorage().getFullPath()));
    String dst_part_name = src_part->getNewName(dst_part_info);
    String tmp_dst_part_name = tmp_part_prefix + dst_part_name;
    auto temporary_directory_lock = getTemporaryPartDirectoryHolder(tmp_dst_part_name);
    
    auto reservation = src_part->getDataPartStorage().reserve(src_part->getBytesOnDisk());
    auto src_part_storage = src_part->getDataPartStoragePtr();
    scope_guard src_flushed_tmp_dir_lock;
    MergeTreeData::MutableDataPartPtr src_flushed_tmp_part;
    
    
    
    if (auto src_part_in_memory = asInMemoryPart(src_part))
    {
        auto flushed_part_path = *src_part_in_memory->getRelativePathForPrefix(tmp_part_prefix);
        auto tmp_src_part_file_name = fs::path(tmp_dst_part_name).filename();
        src_flushed_tmp_dir_lock = src_part->storage.getTemporaryPartDirectoryHolder(tmp_src_part_file_name);
        auto flushed_part_storage = src_part_in_memory->flushToDisk(flushed_part_path, metadata_snapshot);
        src_flushed_tmp_part = createPart(src_part->name, src_part->info, flushed_part_storage);
        src_flushed_tmp_part->is_temp = true;
        src_part_storage = flushed_part_storage;
    }
    String with_copy;
    if (copy_instead_of_hardlink)
        with_copy = " (copying data)";
    auto dst_part_storage = src_part_storage->freeze(relative_data_path, tmp_dst_part_name,  false, {}, copy_instead_of_hardlink, files_to_copy_instead_of_hardlinks);
    LOG_DEBUG(log, "Clone {} part {} to {}{}",
              src_flushed_tmp_part ? "flushed" : "",
              src_part_storage->getFullPath(),
              std::string(fs::path(dst_part_storage->getFullRootPath()) / tmp_dst_part_name),