https://clickhouse-test-reports.s3.yandex.net/17375/99073c26ee2692f8efe2ab14b2d8ae0fd813b80e/fuzzer/fuzzer.log

```
SELECT
    k,
    topK(v)
FROM 
(
    SELECT
        number % 7 AS k,
        arrayMap(x -> arrayMap(x -> if(x = 0, NULL, toString(x)), range(x)), range(intDiv(number, 1))) AS v
    FROM system.numbers
    LIMIT 257
)
GROUP BY k
ORDER BY k ASC
```
void free(const TKey & ) {}
};
/*
 * Specialized storage for StringRef with a freelist arena.
 * Keys of this type that are retained on insertion must be serialized into local storage,
 * otherwise the reference would be invalid after the processed block is released.
 */
template <>
struct SpaceSavingArena<StringRef>
{
    const StringRef emplace(const StringRef & key)
    {
        auto ptr = arena.alloc(key.size);
        std::copy(key.data, key.data + key.size, ptr);
        return StringRef{ptr, key.size};
    }
    void free(const StringRef & key)
    {
        if (key.data)
            arena.free(const_cast<char *>(key.data), key.size);
    }
private:
    ArenaWithFreeLists arena;
};
template
<
    typename TKey,
    typename Hash = DefaultHash<TKey>
>
class SpaceSaving