Skip to content

Conversation

@theory
Copy link
Collaborator

@theory theory commented Oct 31, 2025

Replace the old (and commented-out) code with the new BeginInsert / InsertData / EndInsert pattern in clickhouse-cpp. This greatly simplifies the code, as the most of the necessary logic for creating the insert Block object and tracking the state of the insert is now handled by the Client object.

Remove the old logic for unwrapping LowCardinality columns and fix column_append to properly append to those columns. This preserves traffic over the wire, I'm told. Thanks to @slabko for working out how to make that work again.

Restore the logic for inserting arrays by creating a column of the proper type, then use column_append() to add the items to it before appending it to the ColumnArray. Thanks to @slabko again for the incantation to create a column of the proper type for array items.

Copy the test from the old FDW, but comment out the bit working with arrays, as it has not yet been updated.

@theory theory self-assigned this Oct 31, 2025
@theory theory force-pushed the prepare-insert branch 2 times, most recently from 5e0cb9a to f3537b8 Compare October 31, 2025 20:50
@theory theory force-pushed the prepare-insert branch 2 times, most recently from 64396a3 to 59d1ade Compare November 5, 2025 22:02
@theory theory force-pushed the prepare-insert branch 5 times, most recently from fecfd69 to 07073f4 Compare November 11, 2025 15:15
@theory theory changed the title Implement binary insert with PreparedInsert Implement BeginInsert/InsertData/EndInsert flow Nov 11, 2025
@theory theory force-pushed the prepare-insert branch 5 times, most recently from de366b1 to b2df9d3 Compare November 11, 2025 19:49
@theory theory requested review from serprex and slabko November 12, 2025 18:02
@theory theory force-pushed the prepare-insert branch 5 times, most recently from df8b465 to 1c3af81 Compare November 18, 2025 18:35
Replace the old (and commented-out) code with the new `BeginInsert` /
`InsertData` / `SendInsertBlock` pattern in `clickhouse-cpp`. This
greatly simplifies the code, as the most of the necessary logic for
creating the insert Block object and tracking the state of the insert is
now handled by the Client object.

Remove the old logic for unwrapping `LowCardinality` columns and fix
`column_append` to properly append to those columns. This preserves
traffic over the wire, I'm told. Thanks to @slabko for working out how
to make that work again.

Restore the logic for inserting arrays by creating a column of the
proper type, then use `column_append()` to add the items to it before
appending it to the `ColumnArray`. Thanks to @slabko again for the
incantation to create a column of the proper type for array items.

Copy the test from the old FDW and tweak it to match the other tests.
@theory theory marked this pull request as ready for review November 18, 2025 23:28
@theory theory merged commit 26ae3f4 into main Nov 19, 2025
38 checks passed
@theory theory deleted the prepare-insert branch November 19, 2025 15:36
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 this pull request may close these issues.

4 participants