Skip to content

MapColumn can't nested types that have a comma. #60

@Yibo-Chen13

Description

@Yibo-Chen13

Describe the bug
MapColumn can't nested types that have a comma.like: map(int,Decimal(9,2))map(int,map(int,int)).

def test_nested_map(self):
    with self.create_stream('a map(string, map(int,int))'):
        data = [
            ({},),
            ({'key1': {1: 2}}, ),
            ({'key1': {2: 1}, 'key2': {1: 2}}, ),
            ({'key1': {2: 1}, 'key2': {2: 1}, 'key3': {2: 1}}, )
        ]
        self.client.execute('INSERT INTO test (a) VALUES', data)
        query = 'SELECT * FROM test'
        inserted = self.emit_cli(query)
        self.assertEqual(
            self._sorted_dicts(inserted),
            "{}\n"
            "{'key1':{1:2}}\n"
            "{'key1':{2:1},'key2':{1:2}}\n"
            "{'key1':{2:1},'key2':{2:1},'key3':{2:1}}\n"
        )
        inserted = self.client.execute(query)
        self.assertEqual(inserted, data)

Expected behavior
Expected no error.But:

./tests/columns/test_map.py::MapTestCase::test_nested_map Failed: [undefined]ValueError: too many values to unpack (expected 2)

Versions

package:v0.2.11
Proton server:2.5.1

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions