Имеется Materialized база, данные реплицируюся нормально, в базе данные есть

Если выполнить запрос

```
SELECT 
    DISTINCT P.id, 
    P.name, 
    P.catalog_id
FROM products P 
WHERE 
    P.name ILIKE '%Легкие%'
```

То получим результат:

`   |name                                                                                                |catalog_id|brand_id|
---|----------------------------------------------------------------------------------------------------|----------|--------|
915|Подвеска "Легкие"                                                                                   |      5287|   15837|
990|Кроссовки/Кроссовки текстильные/Кроссовки женские летние/кроссовки легкие/Кроссовки спортивные      |      1053|   24390|
781|Брюки женские / Брюки прямые / Легкие брюки на резинке                                              |      1041|    1176|`

Но если в запрос добавить AND catalog_id = N

```
SELECT 
    DISTINCT P.id, 
    P.name, 
    P.catalog_id
FROM products P 
WHERE 
    P.name ILIKE '%Легкие%' AND P.catalog_id = 5287;
```

Или же так:

```
SELECT 
    DISTINCT P.id, 
    P.name, 
    P.catalog_id,
    P.brand_id 
FROM products P 
WHERE 
    P.catalog_id = 5287 AND P.brand_id = 15837;
```

То получаю ошибки

```
SQL Error [10]: ClickHouse exception, code: 10, Code: 10, e.displayText() = DB::Exception: Not found column equals(catalog_id, 5287) in block: while executing 'INPUT : 1 -> equals(catalog_id, 5287) UInt8 : 1' (version 21.3.4.25 (official build))
```

```
SQL Error [10]: ClickHouse exception, code: 10, Code: 10, e.displayText() = DB::Exception: Not found column equals(brand_id, 15837) in block: while executing 'INPUT : 0 -> equals(brand_id, 15837) UInt8 : 0' (version 21.3.4.25 (official build))
```

Почему так происходит? как выйти из этой ситуации?

Структура
```
CREATE TABLE analyzer.products
(

    `id` Int32,

    `product_id` Int32,

    `catalog_id` Int32,

    `brand_id` Int32,

    `name` Nullable(String),

    `description` Nullable(String),

    `supplier` Nullable(String),

    `marketplace` String,

    `letter` String,

    `isNew` UInt8,

    `isSoldOut` UInt8,

    `created` DateTime,

    `updated` DateTime,

    `_sign` Int8 MATERIALIZED 1,

    `_version` UInt64 MATERIALIZED 1
)
ENGINE = ReplacingMergeTree(_version)
PARTITION BY intDiv(id,
 4294967)
ORDER BY (product_id,
 catalog_id,
 brand_id,
 letter,
 updated,
 id)
SETTINGS index_granularity = 8192
```
const auto & arguments = engine->arguments->children;
        const auto cache_expiration_time_seconds = safeGetLiteralValue<UInt64>(arguments[0], "Lazy");
        return std::make_shared<DatabaseLazy>(database_name, metadata_path, cache_expiration_time_seconds, context);
    }
    else if (engine_name == "Replicated")
    {
        const ASTFunction * engine = engine_define->engine;
        if (!engine->arguments || engine->arguments->children.size() != 3)
            throw Exception("Replicated database requires 3 arguments: zookeeper path, shard name and replica name", ErrorCodes::BAD_ARGUMENTS);
        const auto & arguments = engine->arguments->children;
        String zookeeper_path = safeGetLiteralValue<String>(arguments[0], "Replicated");
        String shard_name = safeGetLiteralValue<String>(arguments[1], "Replicated");
        String replica_name  = safeGetLiteralValue<String>(arguments[2], "Replicated");
        zookeeper_path = context->getMacros()->expand(zookeeper_path);
        shard_name = context->getMacros()->expand(shard_name);
        replica_name = context->getMacros()->expand(replica_name);
        DatabaseReplicatedSettings database_replicated_settings{};
        if (engine_define->settings)
            database_replicated_settings.loadFromQuery(*engine_define);
        return std::make_shared<DatabaseReplicated>(database_name, metadata_path, uuid,
                                                    zookeeper_path, shard_name, replica_name,
                                                    std::move(database_replicated_settings), context);
    }
#if USE_LIBPQXX
    else if (engine_name == "PostgreSQL")
    {
        const ASTFunction * engine = engine_define->engine;
        if (!engine->arguments || engine->arguments->children.size() < 4 || engine->arguments->children.size() > 5)
            throw Exception(fmt::format(
                        "{} Database require host:port, database_name, username, password arguments "