 This bug is reproduced on any version ( 22.1.3.7 , 22.3.11.12 , 22.9.3)

**How to reproduce** 
*(cant reproduce well on fiddle, but easy locally or on production)*

**NOT OK (with preallocate)**
```
CREATE TABLE default.oom_table (key String) ENGINE = MergeTree() ORDER BY tuple();

INSERT INTO default.oom_table SELECT hex(sipHash128(toString(number % 100))) FROM numbers(1000000000);

CREATE VIEW default.oom_view AS SELECT xxHash32(key) hash, key FROM default.oom_table GROUP BY key;

CREATE DICTIONARY default.oom_dict (hash UInt32, key String) PRIMARY KEY hash SOURCE(CLICKHOUSE(host 'localhost' user 'default' port 9000 db 'default' table 'oom_view')) LAYOUT (HASHED(PREALLOCATE 1)) LIFETIME (600);

SELECT * FROM dictionary('default.oom_dict');
```

**Error**
```
Code: 241. DB::Exception: Received from clickhouse-server:9000. DB::Exception: Memory limit (total) exceeded: would use 48.48 GiB (attempt to allocate chunk of 51540792506 bytes), maximum: 13.50 GiB. OvercommitTracker decision: Query was selected to stop by OvercommitTracker.. (MEMORY_LIMIT_EXCEEDED)

```

**OK (without preallocate)**
```
CREATE TABLE default.oom_table (key String) ENGINE = MergeTree() ORDER BY tuple();

INSERT INTO default.oom_table SELECT hex(sipHash128(toString(number % 100))) FROM numbers(1000000000);

CREATE VIEW default.oom_view AS SELECT xxHash32(key) hash, key FROM default.oom_table GROUP BY key;

CREATE DICTIONARY default.oom_dict (hash UInt32, key String) PRIMARY KEY hash SOURCE(CLICKHOUSE(host 'localhost' user 'default' port 9000 db 'default' table 'oom_view')) LAYOUT (HASHED()) LIFETIME (600);

SELECT * FROM dictionary('default.oom_dict');
```


const std::string & attribute_name,
    const DataTypePtr & result_type,
    const Columns & key_columns,
    const DataTypes & key_types [[maybe_unused]],
    const ColumnPtr & default_values_column) const
{
    if (dictionary_key_type == DictionaryKeyType::Complex)
        dict_struct.validateKeyTypes(key_types);
    ColumnPtr result;
    DictionaryKeysArenaHolder<dictionary_key_type> arena_holder;
    DictionaryKeysExtractor<dictionary_key_type> extractor(key_columns, arena_holder.getComplexKeyArena());
    const size_t size = extractor.getKeysSize();
    const auto & dictionary_attribute = dict_struct.getAttribute(attribute_name, result_type);
    const size_t attribute_index = dict_struct.attribute_name_to_index.find(attribute_name)->second;
    auto & attribute = attributes[attribute_index];
    bool is_attribute_nullable = attribute.is_nullable_set.has_value();
    ColumnUInt8::MutablePtr col_null_map_to;
    ColumnUInt8::Container * vec_null_map_to = nullptr;
    if (attribute.is_nullable_set)
    {
        col_null_map_to = ColumnUInt8::create(size, false);
        vec_null_map_to = &col_null_map_to->getData();
    }
    auto type_call = [&](const auto & dictionary_attribute_type)
    {
        using Type = std::decay_t<decltype(dictionary_attribute_type)>;
        using AttributeType = typename Type::AttributeType;
        using ValueType = DictionaryValueType<AttributeType>;
        using ColumnProvider = DictionaryAttributeColumnProvider<AttributeType>;