```sql
CREATE TABLE dt64test
(`dt64column` DateTime64(3))
ENGINE = MergeTree
PARTITION BY toYYYYMM(dt64column)
ORDER BY dt64column;

INSERT INTO dt64test  VALUES ('2020-01-13 13:37:00');

SELECT 1 FROM dt64test WHERE dt64column = toDateTime('2020-01-13 13:37:00');
DB::Exception: Key expression contains comparison between inconvertible types: DateTime64(3) and DateTime

SELECT 1 FROM dt64test WHERE dt64column = materialize(toDateTime('2020-01-13 13:37:00'));
┌─1─┐
│ 1 │
└───┘
```
bool have_unconvertible_element = false;
            for (size_t i = 0; i < map_size; ++i)
            {
                const auto & map_entry = map[i].get<Tuple>();
                const auto & key = map_entry[0];
                const auto & value = map_entry[1];
                Tuple updated_entry(2);
                updated_entry[0] = convertFieldToType(key, key_type);
                if (updated_entry[0].isNull() && !key_type.isNullable())
                    have_unconvertible_element = true;
                updated_entry[1] = convertFieldToType(value, value_type);
                if (updated_entry[1].isNull() && !value_type.isNullable())
                    have_unconvertible_element = true;
                res[i] = updated_entry;
            }
            return have_unconvertible_element ? Field(Null()) : Field(res);
        }
    }
    else if (const DataTypeAggregateFunction * agg_func_type = typeid_cast<const DataTypeAggregateFunction *>(&type))
    {
        if (src.getType() != Field::Types::AggregateFunctionState)
            throw Exception(String("Cannot convert ") + src.getTypeName() + " to " + agg_func_type->getName(),
                    ErrorCodes::TYPE_MISMATCH);
        const auto & name = src.get<AggregateFunctionStateData>().name;
        if (agg_func_type->getName() != name)
            throw Exception("Cannot convert " + name + " to " + agg_func_type->getName(), ErrorCodes::TYPE_MISMATCH);
        return src;
    }
    
    if (src.getType() == Field::Types::String)