**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 Block & result_sample_block_,
                     size_t left_columns_count,
                     const LeftToRightKeyRemap & left_to_right_key_remap)
    : filler(std::move(filler_))
    , saved_block_sample(filler->getEmptyBlock())
    , result_sample_block(materializeBlock(result_sample_block_))
{
    for (size_t left_pos = 0; left_pos < left_columns_count; ++left_pos)
    {
        
        auto left_name = result_sample_block.getByPosition(left_pos).name;
        const auto & right_key = left_to_right_key_remap.find(left_name);
        if (right_key != left_to_right_key_remap.end())
        {
            size_t right_key_pos = saved_block_sample.getPositionByName(right_key->second);
            setRightIndex(right_key_pos, left_pos);
        }
        else
            column_indices_left.emplace_back(left_pos);
    }
    for (size_t right_pos = 0; right_pos < saved_block_sample.columns(); ++right_pos)
    {
        const String & name = saved_block_sample.getByPosition(right_pos).name;
        if (!result_sample_block.has(name))
            continue;
        size_t result_position = result_sample_block.getPositionByName(name);