**Describe what's wrong**

Including a LowCardinality column in an `ON` clause containing an `OR` operator results in this exception:

```
DB::Exception: Expected ColumnLowCardinality, got String: While executing JoiningTransform. (ILLEGAL_COLUMN)
```

**Does it reproduce on recent release?**

22.1.2

**How to reproduce**

Minimal repro case:

```sql
WITH t1 AS
    (
        SELECT toLowCardinality('x') AS col
    )
SELECT *
FROM t1
INNER JOIN t1 AS t2 ON (t1.col = t2.col) OR (t1.col = t2.col)
```

However, casting to String works:

```sql
WITH t1 AS
    (
        SELECT toLowCardinality('x') AS col
    )
SELECT *
FROM t1
INNER JOIN t1 AS t2 ON (CAST(t1.col AS String) = CAST(t2.col AS String)) OR (CAST(t1.col AS String) = CAST(t2.col AS String))
```

Without `OR`, casting is not necessary:

```sql
WITH t1 AS
    (
        SELECT toLowCardinality('x') AS col
    )
SELECT *
FROM t1
INNER JOIN t1 AS t2 ON t1.col = t2.col
```

**Expected behavior**

It should not be necessary to use CAST when joining on a LowCardinality column with multiple `OR` expressions.
{
        const size_t new_items = std::distance(from, to);
        if (items + new_items <= MAX_LINEAR)
        {
            std::copy(from, to, &array_holder[items]);
        }
        else
        {
            if (items <= MAX_LINEAR)
            {
                set_holder_ptr = std::make_unique<SetHolder>();
                set_holder_ptr->insert(std::cbegin(array_holder), std::cbegin(array_holder) + items);
            }
            set_holder_ptr->insert(from, to);
        }
        items += new_items;
    }
    template<class Needle>
    bool isKnown(const Needle & needle)
    {
        return items <= MAX_LINEAR
            ? std::find(std::cbegin(array_holder), std::cbegin(array_holder) + items, needle) != std::cbegin(array_holder) + items
            : set_holder_ptr->find(needle) != set_holder_ptr->end();
    }
};
template<>
class KnownRowsHolder<false>