```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. 

```
const Block & result_sample_block_)
    : saved_block_sample(saved_block_sample_)
    , result_sample_block(materializeBlock(result_sample_block_))
{
    std::vector<String> tmp;
    Block right_table_keys;
    Block sample_block_with_columns_to_add;
    table_join.splitAdditionalColumns(right_sample_block, right_table_keys, sample_block_with_columns_to_add);
    Block required_right_keys = table_join.getRequiredRightKeys(right_table_keys, tmp);
    std::unordered_map<size_t, size_t> left_to_right_key_remap;
    if (table_join.hasUsing())
    {
        for (size_t i = 0; i < table_join.keyNamesLeft().size(); ++i)
        {
            const String & left_key_name = table_join.keyNamesLeft()[i];
            const String & right_key_name = table_join.keyNamesRight()[i];
            size_t left_key_pos = result_sample_block.getPositionByName(left_key_name);
            size_t right_key_pos = saved_block_sample.getPositionByName(right_key_name);
            if (!required_right_keys.has(right_key_name))
                left_to_right_key_remap[left_key_pos] = right_key_pos;
        }
    }
    
    size_t left_columns_count = result_sample_block.columns() -
        sample_block_with_columns_to_add.columns() - required_right_keys.columns();