chore(c/validation): route hardcoded test SQL through the RewriteSql quirk - #28
Open
fornwall wants to merge 1 commit into
Open
chore(c/validation): route hardcoded test SQL through the RewriteSql quirk#28fornwall wants to merge 1 commit into
fornwall wants to merge 1 commit into
Conversation
This was referenced Jul 14, 2026
fornwall
force-pushed
the
validation-rewrite-sql-sites
branch
2 times, most recently
from
July 14, 2026 11:58
2744f78 to
62d8b0c
Compare
… quirk Several statement tests hardcode SQL that is not portable across SQL dialects: CREATE TABLE statements with INT/INTEGER/TEXT columns, INSERT statements without a column list, ORDER BY ... NULLS FIRST/LAST, TEXT types, etc. Route each of these through the new DriverQuirks::RewriteSql hook so driver test harnesses can substitute an equivalent query in their own dialect. Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
fornwall
force-pushed
the
validation-rewrite-sql-sites
branch
from
July 14, 2026 12:08
62d8b0c to
6590897
Compare
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.
What
Routes every dialect-sensitive hardcoded SQL string in
adbc_validation_statement.ccthrough theDriverQuirks::RewriteSql(query_id, default_sql)hook added upstream in apache#4496, so driver harnesses can substitute an equivalent query in their own SQL dialect.Sites covered, each with a stable query id (
StatementTest::<TestName>::<slug>):SELECT * FROM bulk_ingest [ORDER BY ... NULLS FIRST/LAST]) inTestSqlIngestType,TestSqlIngestTemporalType,TestSqlIngestInterval,TestSqlIngestStreamZeroArrays,TestSqlIngestAppend,TestSqlIngestReplace,TestSqlIngestCreateAppend,TestSqlIngestMultipleConnections,TestSqlIngestSample. These break on drivers whose create-mode ingest adds a synthetic key column (soSELECT *has the wrong arity) and on engines that rejectNULLS FIRST/NULLS LAST.CREATE TABLE ... (x INT)with no primary key) inTestSqlBind,TestSqlQueryEmpty,TestSqlQueryInsertRollback,TestSqlQueryRowsAffectedDelete{,Stream}.INSERTwithout a column list inTestSqlBind,TestSqlPrepareUpdate,TestSqlPrepareUpdateStream(GoogleSQL requires an explicit column list).SELECT ?, ?) inTestSqlPrepareSelectParams(some engines cannot infer undeclared parameter types without context).The
TestSqlIngestTypequery id carries the ingested Arrow type (ArrowTypeString(field.type)) as a suffix so quirks can rewrite per type — e.g. a dialect that cannotORDER BYa list-typed column.No behavior change for drivers that do not override
RewriteSql: the default returnsdefault_sqlunchanged.Why fork-internal
Used by adbc-spanner's validation harness (its
ARROW_ADBC_TAGpins this commit); it unlocks ~35 previously-excluded validation cases for the Spanner driver. Candidate for upstreaming to apache/arrow-adbc as a follow-up to apache#4496.🤖 Generated with Claude Code
https://claude.ai/code/session_011hsYQVXuHhnuiBD7XTVo65