 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');
```


std::string password =  config.getString(settings_config_prefix + ".password", "");
        std::string quota_key =  config.getString(settings_config_prefix + ".quota_key", "");
        std::string db = config.getString(settings_config_prefix + ".db", default_database);
        std::string table = config.getString(settings_config_prefix + ".table", "");
        UInt16 port = static_cast<UInt16>(config.getUInt(settings_config_prefix + ".port", default_port));
        auto has_config_key = [](const String & key) { return dictionary_allowed_keys.contains(key); };
        auto named_collection = created_from_ddl
            ? getExternalDataSourceConfiguration(config, settings_config_prefix, global_context, has_config_key)
            : std::nullopt;
        if (named_collection)
        {
            const auto & configuration = named_collection->configuration;
            host = configuration.host;
            user = configuration.username;
            password = configuration.password;
            quota_key = configuration.quota_key;
            db = configuration.database;
            table = configuration.table;
            port = configuration.port;
        }
        ClickHouseDictionarySource::Configuration configuration{
            .host = host,
            .user = user,
            .password = password,
            .quota_key = quota_key,
            .db = db,
            .table = table,
            .query = config.getString(settings_config_prefix + ".query", ""),
            .where = config.getString(settings_config_prefix + ".where", ""),
            .invalidate_query = config.getString(settings_config_prefix + ".invalidate_query", ""),