You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How I can insert data into this table using clickhouse-cpp API? I’m working with Orders.id and Orders.order_id columns as arrays but when method block.AppendColumn called, I’m getting exception:
all columns in block must have same count of rows.
Is there any existing workaround or plans to extend API for nested tables support?
I’m using Clickhouse Restful API to insert data into nested tables. You can use python if it is possible. Python Clickhouse API can work with nested tables.
No, that's not an option. We need to push a lot of data in the shortest time possible (for example, reusing blocks, appending lots of rows before doing an insert), and also consume it in the shortest time possible and in an optimal format.
then a table with arbitrary levels of nested types can be created.
However if try a code inserting a tuple into nested column, I get unsupported exception:
Recommendation: Keep open — fix needed: review PR #575
With the diff of PR #575, select and insert of a Nested(...) column work. The PR closes only #571: add Closes #40 to it, so that this issue closes when it merges.
Category: Feature
Classification: impact: none · area: Data types & formats (Nested)
Status on master: Not supported on main — 30405b0, ClickHouse 26.10.4.207, default 2.x build options: a Nested(...) column (flatten_nested = 0) fails on select and on insert with "unsupported column type".
Analysis: With flatten_nested = 1 (the server default), the server stores a Nested column as Array columns, and the library already inserts and selects them; the error in the report comes from Block::AppendColumn (clickhouse/block.cpp:59) when the columns of a block have different row counts. With flatten_nested = 0, the server sends the type name Nested(...), which TypeParser does not know (clickhouse/types/type_parser.cpp:120), so Client throws (clickhouse/client.cpp:869). PR #575 creates such a column as Array(Tuple(...)), the same structure as the server's DataTypeNested.
Automated triage by Polyglot AI. A maintainer makes the final decision. Shortened on 2026-11-20: the edit history has the first version.
Activity
rpopescu commentedon Oct 19, 2020
@Ryssiouk11B is there a solution for this?
tagging also @Enmk
much appreciated!
Ryssiouk11B commentedon Oct 20, 2020
rpopescu commentedon Oct 20, 2020
No, that's not an option. We need to push a lot of data in the shortest time possible (for example, reusing blocks, appending lots of rows before doing an insert), and also consume it in the shortest time possible and in an optimal format.
romanholidaypancakes commentedon Jun 22, 2022
hi, is this still unusable?
den818 commentedon Nov 27, 2022
I try to write a simple test. And it works. Could you describe the case in more detail?
iso01 commentedon May 13, 2025
I need to support arbitrary level of nested structures. Lets complicated above
Ordersexample with yet another nested layer:test_clickhouse_nested (account UInt64, Orders Nested(id UInt64, order_id String, Items Nested(id UInt64, description String)))What code should I write in this case?
iso01 commentedon May 15, 2025
If I add
then a table with arbitrary levels of nested types can be created.
However if try a code inserting a tuple into nested column, I get unsupported exception:
Presumably the nested columns are not supported by the c++ client at all.
The case with
flatten_nested=1and replacing true nested types by arrays is not what I need.polyglotAI-bot commentedon Nov 19, 2026
Recommendation: Keep open — fix needed: review PR #575
With the diff of PR #575, select and insert of a
Nested(...)column work. The PR closes only #571: addCloses #40to it, so that this issue closes when it merges.master: Not supported on main —30405b0, ClickHouse 26.10.4.207, default 2.x build options: aNested(...)column (flatten_nested = 0) fails on select and on insert with "unsupported column type".Array(Nested(...))decodes asArray(Nothing)).Analysis: With
flatten_nested = 1(the server default), the server stores aNestedcolumn asArraycolumns, and the library already inserts and selects them; the error in the report comes fromBlock::AppendColumn(clickhouse/block.cpp:59) when the columns of a block have different row counts. Withflatten_nested = 0, the server sends the type nameNested(...), whichTypeParserdoes not know (clickhouse/types/type_parser.cpp:120), soClientthrows (clickhouse/client.cpp:869). PR #575 creates such a column asArray(Tuple(...)), the same structure as the server'sDataTypeNested.Automated triage by Polyglot AI. A maintainer makes the final decision. Shortened on 2026-11-20: the edit history has the first version.