`SELECT toDateTime(topKWeighted(-9223372036854775807, '-0.02')(NULL), '104857.5') FROM remote('127.0\00\0{2,3}127.0\00\0{2,3}127.0\00\0{2,3}127.0\00\0{2,3}127.0\00\0{2,3}127.0\00\0{2,3}127.0\00\0{2,3}127.0\00\0{2,3}', system.one) ORDER BY length(topK(1048577)(tuple(NULL))) ASC, '0' ASC NULLS LAST`
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