**Describe the bug**
Exception happens when running query which joins subquery with `group by with totals` clause and table with Join engine.

**How to reproduce**
Clickhouse version 20.7.4.11

```
CREATE TABLE table1 (
  show_date DateTime,
  pu_num String,
  pu_id UInt64,
  amnt UInt32
) ENGINE = MergeTree(
) PARTITION BY toYYYYMM(show_date)
ORDER BY (show_date);

insert into table1 values('2020-01-01 12:00:00', '1234454', 54234, 5);
insert into table1 values('2020-01-02 13:00:00', '1234454', 54234, 7);
insert into table1 values('2020-01-11 15:00:00', '123123', 32434, 4);

CREATE TABLE table2 (
  pu_id UInt64,
  pu_num String,
  name_rus String)
 ENGINE = Join(ANY, LEFT, pu_id) SETTINGS join_use_nulls = 1;

insert into table2 values(32434, '123123', 'Имя_1');
insert into table2 values(54234, '1234454', 'Имя_2');

select dd.pu_id, dd.pu_num, dd.s_amnt, k.name_rus
from (
    select a.pu_id, a.pu_num, sum(a.amnt) as s_amnt
    from table1 a
    group by a.pu_id, a.pu_num with totals
) dd
ANY LEFT JOIN table2 k USING(pu_id) SETTINGS join_use_nulls = 1;
```

**Error message and/or stacktrace**
```
2020.12.02 09:04:41.208576 [ 49155 ] {a90f1fff-f15e-4edb-8e94-d11ea6107029} <Error> DynamicQueryHandler: Code: 49, e.displayText() = DB::Exception: Invalid number of columns in chunk pushed to OutputPort. Expected 4, found 5
Header: pu_id UInt64 UInt64(size = 0), pu_num String String(size = 0), s_amnt UInt64 UInt64(size = 0), name_rus Nullable(String) Nullable(size = 0, String(size = 0), UInt8(size = 0))
Chunk:  UInt64(size = 1) String(size = 1) UInt64(size = 1) Nullable(size = 1, String(size = 1), UInt8(size = 1)) Nullable(size = 1, String(size = 1), UInt8(size = 1))
, Stack trace (when copying this message, always include the lines below):

0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x12723a80 in /usr/bin/clickhouse
1. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0xa3f52bd in /usr/bin/clickhouse
2. ? @ 0xfee4cf3 in /usr/bin/clickhouse
3. DB::PipelineExecutor::prepareProcessor(unsigned long, unsigned long, std::__1::queue<DB::ExecutingGraph::Node*, std::__1::deque<DB::ExecutingGraph::Node*, std::__1::allocator<DB::ExecutingGraph::Node*> > >&, std::__1::unique_lock<std::__1::mutex>) @ 0xff19e08 in /usr/bin/clickhouse
4. ? @ 0xff1bbdb in /usr/bin/clickhouse
5. ? @ 0xff1c356 in /usr/bin/clickhouse
6. ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0xa422ad7 in /usr/bin/clickhouse
7. ? @ 0xa421023 in /usr/bin/clickhouse
8. start_thread @ 0x76db in /lib/x86_64-linux-gnu/libpthread-2.27.so
9. __clone @ 0x121a3f in /lib/x86_64-linux-gnu/libc-2.27.so
 (version 20.7.4.11 (official build))
```


**Additional context**
If column `pu_num` or clause `with totals` are removed from query, it executes without error.

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();