The duckdb_append output component writes rows directly into DuckDB's columnar storage via the Appender API. This method is faster than sql_insert for bulk ingestion because it bypasses SQL parsing.
Key Constraints:
- The target table must exist before the component connects. Use
init_statement or init_files to create the table if necessary. - Rows are flushed to disk on every
WriteBatch call and upon component shutdown.
Type Coercions:
Values produced by args_mapping are coerced as follows:
- JSON integers (
json.Number) → int64 - JSON decimals (
json.Number) → float64 - RFC3339 strings →
time.Time (for TIMESTAMP columns) - Nested types (maps, slices) are recursively coerced for STRUCT and LIST columns
- All other types are passed through unchanged.
output:
duckdb_append:
dsn: /data/vault.duckdb
table: vault_deposits
columns: [ deposit_id, duck, coins, denomination, deposited_at ]
args_mapping: |
root = [
this.deposit_id,
this.duck,
this.coins,
this.denomination,
this.deposited_at,
]
init_statement: |
CREATE TABLE IF NOT EXISTS vault_deposits (
deposit_id VARCHAR PRIMARY KEY,
duck VARCHAR NOT NULL,
coins BIGINT NOT NULL,
denomination VARCHAR NOT NULL,
deposited_at TIMESTAMP NOT NULL
)
batching:
count: 10000
period: 5s