chore(c/validation): add quirk for identifier quoting#4504
Conversation
09cf9d3 to
ff91980
Compare
ff91980 to
ed95572
Compare
The reason for AdbcStatusCode AdbcStatementSetSqlQuery(struct AdbcStatement* statement,
const char* query, struct AdbcError* error);This contrasts to the validation suite internal functions, which is C++ and takes strings or string views. Given that, I don't think One thing we could do here to perhaps reduce noice is extracting the query into a variable, like: ASSERT_THAT(AdbcStatementSetSqlQuery(
&statement,
("SELECT * FROM " + quirks()->QuoteIdentifier("bulk_ingest") +
" ORDER BY " + quirks()->QuoteIdentifier("col") + " ASC NULLS FIRST")
.c_str(),
&error),
IsOkStatus(&error));-> std::string query = ("SELECT * FROM " + quirks()->QuoteIdentifier("bulk_ingest") +
" ORDER BY " + quirks()->QuoteIdentifier("col") + " ASC NULLS FIRST");
ASSERT_THAT(AdbcStatementSetSqlQuery(&statement, query.c_str(), &error),
IsOkStatus(&error));Should I do that here? |
|
ah you're right, I was scrolling too quickly and thought we were using it inside the concat instead of outside |
|
What I think I actually want is to upgrade to C++20 so we can use std::format but for now I think this is OK |
It's probably a good time, right? Created #4506 for that. I can update to use |
432f431 to
0062798
Compare
Add a identifier quoting hook whose default reproduces the current ANSI double-quoted identifier quoting. Existing drivers are unaffected - new drivers for databases not supporting double quotes for identifiers (such as GoogleSQL ones, which use backticks) can override the hook. Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
0062798 to
8468c47
Compare
…entifier quirk (#278) Advance the C++ validation-suite pin from 1388615 to apache/arrow-adbc main @ 9be02985. The only suite change in the delta is apache/arrow-adbc#4504, which adds the DriverQuirks::QuoteIdentifier hook and routes the previously hardcoded ANSI double-quoted identifiers in the ingest/prepare readback and DDL statements through it. SpannerQuirks now overrides the hook to GoogleSQL backticks, so identifier quoting is no longer part of what keeps the EXCLUDED ingest-readback / non-Spanner-DDL buckets excluded; the remaining blockers (INT/TEXT no-PK DDL, the synthetic adbc_ingest_key column surfaced by `SELECT *`, the INSERT arity in SqlPrepareUpdate*) are re-documented in the bucket comments. No EXCLUDED entry changes: the gate still runs 58 cases (52 pass, 6 self-skip) and the expected-failure guard confirms all 42 excluded cases still fail or skip on the new pin. Also: - Reword the CMakeLists pin comment: the C++ suite pin and the Rust adbc_core/adbc_ffi pin in Cargo.toml are the same family but bumped independently and may differ. - Force arrow-adbc's from-source googletest fallback (CMAKE_DISABLE_FIND_PACKAGE_GTest): an installed GTest config package (e.g. linuxbrew) is directory-scoped to the fetched subproject and broke the top-level target_link_libraries, and hermetic from-source is the suite's stated design anyway. - Fix stale counts in adbc-validation/README.md (42 excluded / 58 gate-enforced, not 45 / 55). Claude-Session: https://claude.ai/code/session_01Ao7MRWDTdb3rdgN9kWBf3e Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Add a identifier quoting hook whose default reproduces the current ANSI double-quoted identifier quoting.
Existing drivers are unaffected - new drivers for databases not supporting double quotes for identifiers (such as GoogleSQL ones, which use backticks) can override the hook.
This mirrors what the adbc-drivers/driverbase-go validation harness does through its optional
TableQuoterinterface, which also defaults to ANSI double quotes.