Gabriel39 opened a new pull request, #68768:
URL: https://github.com/apache/doris/pull/68768
### What problem does this PR solve?
Flight SQL prepared queries containing `?` fail because Prepare rejects
placeholders and `acceptPutPreparedStatementQuery` returns `UNIMPLEMENTED`. For
example, ADBC cannot bind an integer to `SELECT CAST(? AS BIGINT)` or execute a
range predicate with two bound values.
This change implements single-row typed parameter binding on branch-4.1.
Prepare advertises parameter positions, DoPut converts Arrow values into
detached Nereids literals, and execution binds those literals to a fresh
statement context. Result schemas are analyzed after binding. Values are never
interpolated into SQL text.
Failed rebinds invalidate previous values. Handle ownership, concurrent
closure, upload versions, and per-binding/session memory limits protect
retained state. Multi-row uploads and unsupported types fail explicitly.
Queries requiring forwarding to the master FE reject bound parameters because
the forwarding protocol cannot carry typed bindings.
### Release note
Support single-row scalar parameter binding for Flight SQL prepared queries,
including repeated execution and NULL values.
### Check List (For Author)
- Test
- [x] Regression test
- [x] Unit Test
- [x] Manual test
- Behavior changed:
- [x] Yes. Parameterized Flight SQL queries can bind and execute
supported scalar values.
- Does this need documentation?
- [x] No. This implements the existing prepared-query protocol.
Validation:
- FE Checkstyle passed (`mvn -B -pl fe-core -am checkstyle:check`).
- Focused compilation of the changed FE classes and tests passed using
existing FE dependency artifacts.
- 14 new tests and 33 existing Flight SQL schema tests passed.
- The new regression suite passed against a local FE service test harness
and a real BE, including result fetching, rebinding, NULL, mixed types, range
predicates, and recovery after invalid uploads.
- ADBC 1.11.0 with PyArrow 23.0.1 passed 18 concurrent connections and 540
parameterized queries, with result verification plus NULL and connection-reuse
checks. ADBC 1.12.0 also passed the same matrix.
The local integration harness uses one FE service and one real BE; a full
multi-FE cluster run and full FE build are left to CI.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]