Skip to content

etl: Use ADBC bulk ingest for AdbcSink inserts#106

Merged
lukekim merged 19 commits into
trunkfrom
phillip/260219-adbc-bulk-ingest
Feb 20, 2026
Merged

etl: Use ADBC bulk ingest for AdbcSink inserts#106
lukekim merged 19 commits into
trunkfrom
phillip/260219-adbc-bulk-ingest

Conversation

@phillipleblanc
Copy link
Copy Markdown
Contributor

Summary

Replace per-row SQL INSERT statement construction with the ADBC bulk ingest API for AdbcSink insert operations. This sends Arrow RecordBatch data directly to the driver without serializing each cell to a SQL literal.

Changes

crates/adbc_client/src/lib.rs

  • Add bulk_ingest() method to AdbcConnection that configures a statement with TargetTable, TargetDbSchema, and IngestMode, then calls bind(batch) + execute_update()
  • Re-export adbc_core::options::IngestMode for downstream use

crates/etl/src/sink/adbc.rs

  • Insert path: calls bulk_ingest_batch() with IngestMode::Append instead of building batched SQL INSERT strings
  • Removed: auto_create_tables flag, created_tables tracking, new_without_table_creation() constructor, insert_sql_for_rows(), create_table_sql(), sql_type_for_arrow(), DEFAULT_INSERT_ROWS_PER_STATEMENT
  • Kept: per-row SQL for Update/Delete operations (no bulk ingest equivalent in ADBC)
  • Tables are pre-created via the system adapter create_table RPC, so the sink always uses IngestMode::Append

src/main.rs

  • Update AdbcSink::new_without_table_creation()AdbcSink::new() (single constructor now)

Replace per-row SQL INSERT statement construction with the ADBC bulk
ingest API (Statement::bind + execute_update with IngestMode::Append).

This sends Arrow RecordBatch data directly to the driver without
serializing each cell to a SQL literal, which is significantly faster
for large batches.

Tables are pre-created via the system adapter create_table RPC, so the
sink always uses IngestMode::Append. The auto_create_tables flag and
created_tables tracking are removed.

Update and Delete operations continue to use per-row SQL as the ADBC
bulk ingest API only supports append semantics.
@lukekim lukekim self-assigned this Feb 20, 2026
@lukekim lukekim enabled auto-merge (squash) February 20, 2026 01:35
@lukekim lukekim merged commit 7902c7b into trunk Feb 20, 2026
10 of 11 checks passed
@lukekim lukekim deleted the phillip/260219-adbc-bulk-ingest branch February 20, 2026 01:39
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.

3 participants