22.4.5

```sql
SELECT dummy
FROM cluster(test_cluster_two_shards, system.one)
WHERE dummy IN (
    SELECT dummy
    FROM cluster(test_cluster_two_shards, system.one)
)
LIMIT 1 BY dummy
SETTINGS distributed_product_mode = 'local'


Received exception from server (version 22.4.5):
Code: 43. DB::Exception: Received from localhost:9000. 
DB::Exception: Cannot create column of type Set. (ILLEGAL_TYPE_OF_ARGUMENT)

```

22.3.4.20
```sql
SELECT dummy
FROM cluster(test_cluster_two_shards, system.one)
WHERE dummy IN (
    SELECT dummy
    FROM cluster(test_cluster_two_shards, system.one)
)
LIMIT 1 BY dummy
SETTINGS distributed_product_mode = 'local'

┌─dummy─┐
│     0 │
└───────┘
```
{
    auto set_key = PreparedSetKey::forSubquery(*subquery_or_table_name);
    if (prepared_sets.contains(set_key))
        return; 
    if (auto set_ptr_from_storage_set = isPlainStorageSetInSubquery(subquery_or_table_name))
    {
        prepared_sets.insert({set_key, set_ptr_from_storage_set});
        return;
    }
    auto interpreter_subquery = interpretSubquery(subquery_or_table_name, getContext(), {}, query_options);
    auto io = interpreter_subquery->execute();
    PullingAsyncPipelineExecutor executor(io.pipeline);
    SetPtr set = std::make_shared<Set>(settings.size_limits_for_set, true, getContext()->getSettingsRef().transform_null_in);
    set->setHeader(executor.getHeader().getColumnsWithTypeAndName());
    Block block;
    while (executor.pull(block))
    {
        if (block.rows() == 0)
            continue;
        
        if (!set->insertFromBlock(block.getColumnsWithTypeAndName()))
            return;
    }
    set->finishInsert();
    prepared_sets[set_key] = std::move(set);
}
SetPtr ExpressionAnalyzer::isPlainStorageSetInSubquery(const ASTPtr & subquery_or_table_name)