Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nested Map column #314

Closed
aksenof opened this issue Jun 6, 2024 · 0 comments · Fixed by #315
Closed

Support nested Map column #314

aksenof opened this issue Jun 6, 2024 · 0 comments · Fixed by #315

Comments

@aksenof
Copy link
Contributor

aksenof commented Jun 6, 2024

Bug place:
On this place: https://github.com/xzkostyan/clickhouse-sqlalchemy/blob/master/clickhouse_sqlalchemy/drivers/base.py#L276

inner.split(',') can't work with type Map inside Map, for example: Map(String, Map(String, String))

How to get error:
When you try to create column 'map_column' with this nested type, get error: Did not recognize type 'Strin' of column 'map_column'

How to fix:
For support nested Map, need change inner.split(',') for only 1 maxsplit -> inner.split(',', 1). Fix won't break the old logic, because Map only takes 2 values

Versions
clickhouse-sqlalchemy 0.3.1
SQLAlchemy 2.0.29
Python 3.11

aksenof pushed a commit to aksenof/clickhouse-sqlalchemy that referenced this issue Jun 6, 2024
aksenof pushed a commit to aksenof/clickhouse-sqlalchemy that referenced this issue Jun 7, 2024
aksenof pushed a commit to aksenof/clickhouse-sqlalchemy that referenced this issue Jun 10, 2024
xzkostyan pushed a commit that referenced this issue Jun 10, 2024
* Support Nested Map Type (#314)

* Add tests for Map and nested map (#314)

* fix flake8 (#314)

---------

Co-authored-by: aaksenov <aaksenov@dpkapp.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant