**Describe what's wrong**


**How to reproduce**


```sql

SELECT mapPopulateSeries(range(10), range(10), toUInt8(number))
FROM numbers(10)
LIMIT 1

Query id: 5eb2e3fb-26a0-4a17-8a37-9714d35095bd

┌─mapPopulateSeries(range(10), range(10), toUInt8(number))─┐
│ ([0],[0])                                                │
└──────────────────────────────────────────────────────────┘
┌─mapPopulateSeries(range(10), range(10), toUInt8(number))─┐
│ ([0],[0])                                                │
└──────────────────────────────────────────────────────────┘

2 rows in set. Elapsed: 0.004 sec.

SELECT mapPopulateSeries(range(900), range(900), materialize(1000)).2
FROM numbers(100)
FORMAT `Null`

Query id: 6418bf79-5d29-4709-86d6-7bdee9b7c9f7

← Progress: 0.00 rows, 0.00 B (0.00 rows/s., 0.00 B/s.)
1 rows in set. Elapsed: 0.014 sec.

Received exception from server (version 21.13.1):
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: Invalid number of rows in Chunk column Array(UInt16) position 0: expected 100, got 1. (LOGICAL_ERROR)

SELECT mapPopulateSeries(range(900), range(900), toUInt16(number)).2
FROM numbers(100)
LIMIT 1000

┌─tupleElement(mapPopulateSeries(range(900), range(900), toUInt16(number)), 2)─┐
│ [0]                                                                          │
└──────────────────────────────────────────────────────────────────────────────┘
→ Progress: 0.00 rows, 0.00 B (0.00 rows/s., 0.00 B/s.)
1 rows in set. Elapsed: 0.007 sec.

Received exception from server (version 21.13.1):
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: Invalid number of rows in Chunk column Array(UInt16) position 0: expected 100, got 1. (LOGICAL_ERROR)

SELECT mapPopulateSeries(range(10), range(10), toUInt16(number))
FROM numbers(10)
LIMIT 1

Query id: 7b6d6e3d-19f1-489b-93a7-022eaa507af4


0 rows in set. Elapsed: 0.003 sec.

Received exception from server (version 21.13.1):
Code: 43. DB::Exception: Received from localhost:9000. DB::Exception: Max key type in mapPopulateSeries should be same as keys type: While processing mapPopulateSeries(range(10), range(10), toUInt16(number)). (ILLEGAL_TYPE_OF_ARGUMENT)
```

**Expected behavior**

> A clear and concise description of what you expected to happen.

**Error message and/or stacktrace**

```
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: Invalid number of rows in Chunk column Array(UInt16) position 0: expected 100, got 1. (LOGICAL_ERROR)
```
{
        if (arguments.empty())
            throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, getName() + " accepts at least one map or two arrays");
        if (arguments[0]->getTypeId() == TypeIndex::Array)
            return getReturnTypeForTuple(arguments);
        else if (arguments[0]->getTypeId() == TypeIndex::Map)
            return getReturnTypeForMap(arguments);
        else
            throw Exception(
                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
                "Function {} only accepts one map or arrays, but got {}",
                getName(),
                arguments[0]->getName());
    }
    
    
    template <typename KeyType, typename ValType>
    struct ColumnsInOut
    {
        
        const PaddedPODArray<KeyType> & in_keys_data;
        const PaddedPODArray<ValType> & in_vals_data;
        const IColumn::Offsets & in_key_offsets;
        const IColumn::Offsets & in_val_offsets;
        size_t row_count;
        bool key_is_const;
        bool val_is_const;
        
        PaddedPODArray<KeyType> & out_keys_data;
        PaddedPODArray<ValType> & out_vals_data;