```sql
CREATE TABLE t
(
   id Int64, 
   d String,
   p Map(String, String)
   
)
ENGINE = ReplacingMergeTree order by id settings index_granularity  = 0;


insert into t values (1,  's', {'a':'b'});

CH starts eating RAM until it crashes

the same with

insert into t select 1,  's', map('a','b');

```

if (index_file_hashing_stream)
    {
        if (write_final_mark)
        {
            for (size_t j = 0; j < index_columns.size(); ++j)
            {
                const auto & column = *last_block_index_columns[j];
                size_t last_row_number = column.size() - 1;
                index_columns[j]->insertFrom(column, last_row_number);
                index_types[j]->getDefaultSerialization()->serializeBinary(
                    column, last_row_number, compress_primary_key ? *index_source_hashing_stream : *index_file_hashing_stream, {});
            }
            last_block_index_columns.clear();
        }
        if (compress_primary_key)
            index_source_hashing_stream->next();
        index_file_hashing_stream->next();
        String index_name = "primary" + getIndexExtension(compress_primary_key);
        if (compress_primary_key)
        {
            checksums.files[index_name].is_compressed = true;
            checksums.files[index_name].uncompressed_size = index_source_hashing_stream->count();
            checksums.files[index_name].uncompressed_hash = index_source_hashing_stream->getHash();
        }
        checksums.files[index_name].file_size = index_file_hashing_stream->count();
        checksums.files[index_name].file_hash = index_file_hashing_stream->getHash();
        index_file_stream->preFinalize();
    }
}
void MergeTreeDataPartWriterOnDisk::finishPrimaryIndexSerialization(bool sync)