Skip to content

test(c/validation): assert a null-typed (NA) bound parameter column is accepted - #25

Open
fornwall wants to merge 1 commit into
mainfrom
validation/bind-null-type
Open

test(c/validation): assert a null-typed (NA) bound parameter column is accepted#25
fornwall wants to merge 1 commit into
mainfrom
validation/bind-null-type

Conversation

@fornwall

@fornwall fornwall commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Split out from #21 (4/5).

Adds StatementTest.SqlBindNullType to the generic C++ validation suite: a driver must accept a bind batch containing a null-typed (NA, all-NULL) parameter column.

  • adbc-spanner finding: CONV-1 (Null-typed bind columns rejected)
  • Spec reference: adbc.h doc for AdbcStatementGetParameterSchema (adbc.h:2284-2286): "If the type cannot be determined, the type of the corresponding field will be NA (NullType)" — a client that builds its bind batch from exactly the schema the driver advertises (or pyarrow inferring null for an all-None parameter list) produces NA columns, which the driver must accept.
  • Expected on current adbc-spanner: FAIL — INVALID_ARGUMENT: cannot bind parameter "p0": unsupported Arrow type Null (verified by actual run on the Spanner emulator).
  • On SQLite: passes; guarded by supports_dynamic_parameter_binding().
  • On Flight SQL (SQLite example server): skipped via a fixture override in sqlite_flightsql_test.cc. The in-tree driver transmits the null-typed parameters correctly (verified against the server in-process), but the arrow-go example server's SqlBatchReader cannot materialize result columns of unknown/dense-union type, so SELECT ? with a NULL parameter silently returns zero rows. This is an upstream apache/arrow-go example-server limitation, not a driver bug.

The test is written against the generic DriverQuirks fixtures, so it auto-enrolls for every driver using ADBCV_TEST_STATEMENT; candidate for later upstream submission to apache/arrow-adbc.

Verified on this branch: full SQLite suite 123 passed / 15 skipped / 0 failed. FlightSQL suite verified locally against the arrow-go example server: SqlBind passes, SqlBindNullType skips.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EGHTnNywAfCfbe4DoNcfuz

…s accepted

AdbcStatementGetParameterSchema reports parameters whose type cannot be
determined as NA (adbc.h), and clients like pyarrow infer a null-typed
column for an all-None parameter list. A driver must therefore accept a
bind batch containing a null-typed column, treating every value as NULL.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LGf8PVEe2tYkw8Q6Pd95tq
@fornwall
fornwall force-pushed the validation/bind-null-type branch from 20855da to 69beb68 Compare July 13, 2026 17:54
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.

1 participant