```sql
CREATE TABLE t (item_id UInt64, price_sold Float32, date Date) ENGINE MergeTree ORDER BY item_id;
SELECT id, yago FROM (SELECT item_id AS id, materialize([arrayJoin([NULL, NULL]), NULL AS x, arrayJoin([0.9998999834060669, NULL, NULL, NULL]), arrayJoin([1048577, -inf, 100.0000991821289, NULL])]), SUM(price_sold) AS recent FROM t WHERE and(date >= NULL) GROUP BY 1023, id WITH TOTALS) AS ll FULL OUTER JOIN (SELECT item_id AS id, SUM(price_sold) AS yago FROM t WHERE (date >= '2018-12-17') AND (date <= '2019-03-10') GROUP BY id WITH TOTALS) AS rr USING (id);
```
```sql
SELECT
    id,
    yago
FROM 
(
    SELECT
        item_id AS id,
        materialize([arrayJoin([NULL, NULL]), NULL AS x, arrayJoin([0.9998999834060669, NULL, NULL, NULL]), arrayJoin([1048577, -inf, 100.0000991821289, NULL])]),
        SUM(price_sold) AS recent
    FROM t
    WHERE and(date >= NULL)
    GROUP BY
        1023,
        id
        WITH TOTALS
) AS ll
FULL OUTER JOIN 
(
    SELECT
        item_id AS id,
        SUM(price_sold) AS yago
    FROM t
    WHERE (date >= '2018-12-17') AND (date <= '2019-03-10')
    GROUP BY id
        WITH TOTALS
) AS rr USING (id)

Query id: 308fbfd9-aed7-4de6-9f34-843c909b9243


Received exception from server (version 21.1.1):
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: Invalid number of rows in Chunk column Float64 position 1: expected 32, got 1. 

```
for (size_t left_pos = 0; left_pos < left_columns_count; ++left_pos)
    {
        
        if (left_to_right_key_remap.count(left_pos))
        {
            size_t right_key_pos = left_to_right_key_remap[left_pos];
            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);
        
        if (result_position < left_columns_count)
            continue;
        setRightIndex(right_pos, result_position);
    }
    if (column_indices_left.size() + column_indices_right.size() + same_result_keys.size() != result_sample_block.columns())
        throw Exception("Error in columns mapping in RIGHT|FULL JOIN. Left: " + toString(column_indices_left.size()) +
                        ", right: " + toString(column_indices_right.size()) +
                        ", same: " + toString(same_result_keys.size()) +
                        ", result: " + toString(result_sample_block.columns()),
                        ErrorCodes::LOGICAL_ERROR);
}
void NotJoined::setRightIndex(size_t right_pos, size_t result_position)