Repository navigation
Conversation
|
|
lidavidm
left a comment
There was a problem hiding this comment.
Seems reasonable to me. Do you want to start a discussion on the mailing list?
|
@CurtHagenlocher I think we talked about adding more dialect flags to ADBC before to help applications that have to generate SQL; is this the kind of thing you were envisioning? |
My feelings are colored by the fact that the majority of my experience has been with ODBC where the flags are woefully inadequate (and often wrong). It's put me off of the "flags" approach entirely. I have the vague understanding that the JDBC flags are more extensive (and have been updated more recently) but I don't have the kind of personal experience with them which would convince me that it's a workable approach. The Flight SQL flags don't have enough information to correctly encode a CHAR literal. I mention this not because I think it should be added but as an example of something fairly basic that's missing and which is suggestive of additional gaps. |
|
@CurtHagenlocher I do get the sentiment, but I still think it's worth giving a shot. ADBC is still fresh enough that we should be able to cover most of the basic functionality in most drivers to create some value. We also might be able to create some sort of an ecosystem pressure I'm hoping. if spark, pbi, duckdb UX improves by providing enough of the sql metadata, there should be an incentive. The way I'm looking at it, the only alternatives are:
|
Align Q1-Q6 with the Spark SPIP template: plain-language Q1, non-goals in Q2, merged problem statement into Q3, short Q4 with design detail moved to Appendix B. Write path now points to partitioned bulk ingest (apache/arrow-adbc#4317) and dialect handling to driver-reported SqlInfo codes (apache/arrow#49796). Drop Q7/Q8 for now. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@ianmcook As you suggested I expanded the test suite quite of bit both in terms of drivers and use cases (different data types mainly) over in spark-adbc. I included all "proper" sql adbc drivers from dbc (plus gizmodata's oracle driver). There were additional gaps as @CurtHagenlocher predicted, mainly around literal building. To render literals correctly I would have needed all of these and maybe more:
So I've changed direction. Instead of describing literals, the PR now reports how to write a parameter marker ( What remains is syntax that binding can't replace: limit/offset grammar,
|
Rationale for this change
Fills gaps in
SqlInfodialect metadata for axes that clients need when compiling SQL per-backend. Motivation and use case in #49792.What changes are included in this PR?
format/FlightSql.proto— four newint32_bitmaskSqlInfocodes (577–580):SQL_SUPPORTED_LIMIT_OFFSET(577) — row-limit and offset grammars:LIMIT n,LIMIT n OFFSET m,FETCH FIRST n ROWS ONLY,OFFSET m ROWS FETCH NEXT n ROWS ONLY,TOP n, plus a bit for whether theFETCHgrammars are accepted withoutORDER BY.SQL_SUPPORTED_NULLS_ORDERING(578) — whether explicitNULLS FIRST/NULLS LASTis accepted.SQL_SUPPORTED_LIKE_ESCAPE(579) — how%and_are escaped in a LIKE pattern:ESCAPEclause and/or implicit backslash.SQL_SUPPORTED_PARAMETER_MARKER(580) — parameter marker spellings in a prepared statement:?,$1,:1,@p1.cpp/src/arrow/flight/sql/types.h— the same codes and enums.SQL_SUPPORTED_GROUP_BY/SupportedSqlGrammarconvention — enum values are bit positions;SQL_SUPPORTED_NULLS_ORDERING(578) is intentionally distinct from the pre-existingSQL_NULL_ORDERING(507) — the latter reports the server's default null ordering; the new flag reports whether the explicitNULLS FIRST/NULLS LASTclause is accepted.SQL_SUPPORTED_LIKE_ESCAPE(579) supersedes the pre-existingSQL_SUPPORTS_LIKE_ESCAPE_CLAUSE(523), which cannot describe a server that escapes without anESCAPEclause.SQL_SUPPORTED_BOOLEAN_LITERALandSQL_SUPPORTED_DATETIME_LITERALfrom the first revision are removed.Are these changes tested?
No behavior change.
Are there any user-facing changes?
New
SqlInfocodes and supporting enums available to clients and servers. Fully backwards-compatible; no existing codes or types change.