feat(adbc_insert): pass driver-specific statement options - #17
Merged
Merged
Conversation
adbc_insert only set adbc.ingest.target_table and adbc.ingest.mode, so statement-level ingest options drivers expose were unreachable. Add an options named parameter (STRUCT or MAP, same shape as adbc_connect) applied after target table and mode. Keys adbc_insert owns are rejected; unknown keys surface the driver's error.
Contributor
|
Hi @jatorre looking at this now. |
Contributor
|
Looks good to me, I'll merge once CI goes green! Thanks @jatorre |
Contributor
|
@jatorre waiting for merge into community extensions repo: duckdb/community-extensions#2776 |
Contributor
Author
|
that was quick! thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
adbc_insertonly setsadbc.ingest.target_tableandadbc.ingest.modeon the statement, so there's no way to reach ingest options that drivers expose at statement level.The motivating case is the Snowflake driver: its GeoArrow auto-detect correctly maps planar-edge input (what DuckDB produces) to
GEOMETRY, and expects callers who wantGEOGRAPHYto say so withadbc.snowflake.statement.ingest_geo_type(see adbc-drivers/snowflake#167). Other drivers have similar statement-level knobs, such as ADBC 1.1'sadbc.ingest.temporary,adbc.ingest.target_catalogandadbc.ingest.target_db_schema.This adds
options :=, a STRUCT or MAP with the same shapeadbc_connectaccepts. It is applied after the target table and mode. Keysadbc_insertalready owns (adbc.ingest.target_table,adbc.ingest.mode) are rejected, and unknown keys surface the driver's own error.Tests (
test/sql/adbc_insert.test, SQLite driver) useadbc.ingest.temporaryto show the option reaches the driver: the table lands intemp, notmain. They cover both STRUCT and MAP forms and the three error paths (reserved key, non-STRUCT/MAP value, unknown driver option). The fulltest/sql/*suite passes locally withHAS_ADBC_SQLITE_DRIVER=1(834 assertions; the Postgres/MySQL/Trino server tests were skipped).