marcboeker / go-duckdb

go-duckdb provides a database/sql driver for the DuckDB database engine.
MIT License
646 stars 97 forks source link

[Appender] Use append_data_chunk to increase performance and to support nested types #135

Closed taniabogatsch closed 8 months ago

taniabogatsch commented 9 months ago

Currently, the Appender operates row-at-a-time with duckdb_append_TYPE. However, DuckDB performs significantly better with bulk appends, i.e., with appending whole data chunks. The C API offers duckdb_append_data_chunk.

Additionally, there is no support for nested types in the Appender, and while duckdb supports appending Value in the C++ API (DUCKDB_API void BaseAppender::Append(Value value)), it does not offer the same in the C API.

We want to pick this up and rework the Appender to use duckdb_append_data_chunk and eventually allow appending nested types by building these data chunks recursively. I've decided to open this issue to make potential other developers aware that there is work on this. I hope that's fine. :) I will close it once there is an initial PR.

Affiliation: DuckDB Labs

marcboeker commented 8 months ago

139 has been merged.