[fix](arrow-flight) Do not take the point-query short circuit on an Arrow Flight connection - #67487
Merged
Merged
Conversation
…rrow Flight connection
A UNIQUE KEY point query that qualifies for the short circuit returned no Flight
endpoint over Arrow Flight SQL, so the client failed with
fetch arrow flight schema failed, no FlightSqlEndpointsLocations
and the row was silently dropped. `SET_VAR(enable_short_circuit_query=false)` on the
same connection returned it.
The short circuit produces no Arrow result at either end:
* It runs on PointQueryExecutor, not a Coordinator, and Coordinator/NereidsCoordinator
are the only places that register a FlightSqlEndpointsLocation. StmtExecutor's Arrow
Flight branch then returns early with nothing registered, never calling getNext(), so
GetFlightInfo found an empty endpoint list.
* The BE cannot be pointed at either. tablet_fetch_data serializes with
VMysqlResultWriter into PTabletKeyLookupResponse.row_batch and runs no fragment, so
the ArrowFlightResultBlockBuffer that fetch_arrow_flight_schema looks up by finst id
never exists.
Nothing gated the rewrite on the connect type, and enable_short_circuit_query defaults
to true, so every ADBC / Arrow Flight JDBC point query on a MoW + light-schema-change +
store_row_column table hit this. Prepared statements go through the same
executeQueryStatement and failed identically.
Keep Arrow Flight SQL on the normal execution path. This has to be decided at plan time
rather than when picking the executor: OlapScanNode.computeTabletInfo and several
rewrite and property rules read StatementContext.isShortCircuitQuery() while the plan is
being built, so flipping the flag later would run a coordinator over a plan shaped for a
different execution mode. MySQL connections keep the short circuit unchanged.
Also refreshes a now-stale comment in StmtExecutor that said point queries reach the
Arrow Flight deferral gate.
Verified on a local single-FE + single-BE cluster: the new regression test passes with
the fix, and fails without it on the same cluster, with the explain showing
`VRESULT SINK / ARROW_FLIGHT_PROTOCOL` and `SHORT-CIRCUIT` in one plan.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017omcvWDsxEc9AyU83aBZ2g
morningman
requested review from
924060929,
englefly,
morrySnow and
starocean999
as code owners
September 3, 2026 09:55
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
Author
|
/review |
12 tasks
Contributor
There was a problem hiding this comment.
Review result: request changes for one regression-test convention issue.
Critical checkpoints:
- Goal and correctness: the planner-time Arrow Flight fence addresses the no-endpoint failure at the authoritative short-circuit marker, before partition pruning and physical-property consumers. Normal, EXPLAIN, Flight prepared-handle, SQL prepared, retry, matching-row, and empty-row paths were traced; no stale marker or alternate point-executor path remains for an Arrow connection.
- Scope and clarity: the production change is focused to one enum gate plus a clarifying StmtExecutor comment. Error handling is not suppressed; Arrow is routed to the established coordinator path.
- Concurrency and lifecycle: no new locks or shared mutable lifecycle are introduced. The stable volatile connection type is read during synchronous planning, and the existing deferred coordinator/result-buffer lifecycle spans GetFlightInfo and DoGet. Endpoint IDs match BE buffer IDs in both normal and parallel result-sink modes.
- Configuration and compatibility: no config, persistence, transaction/write behavior, FE-BE field, storage format, or symbol compatibility changes are introduced. MySQL retains the short circuit; Arrow intentionally pays normal-plan cost until the point executor can produce Arrow results.
- Tests: the FE unit test controls the marker and ordinary empty plan; the end-to-end regression controls MySQL eligibility, Flight planning, actual matching and missing results, type preservation, the disable hint, and a non-point query. I inspected but did not execute tests because this review environment explicitly prohibits builds/tests.
- Observability: the existing endpoint/schema errors and coordinator logging are adequate for this narrow routing change; no new metric is required.
- User focus and completion: no additional user focus was provided. Two review rounds converged with every candidate accepted, deduplicated, or dismissed with code evidence; the single accepted issue is inline below.
Separately, the current PR title check is failing because the workflow regex does not accept the arrow-flight scope. arrow_flight or arrow flight matches that checker. Compile, FE UT, and performance checks were still pending when this review was submitted.
hello-stephen
pushed a commit
that referenced
this pull request
Sep 3, 2026
…67491) ### What problem does this PR solve? Issue Number: close #xxx Related PR: #66957 (introduced the title-checker regression), #67487 (a PR currently blocked by it) Problem Summary: Two independent bugs in the repository's `.github` tooling, both of which make it easy to get a PR wrong for reasons unrelated to its content. --- #### 1. The PR title checker rejects any hyphen in the type or scope ``` [fix](arrow-flight) ... [feature](inverted-index) ... [improvement](github-actions) ... ``` **88 of the last 1500 commits on master use such a title**, including #66957 itself — the change that introduced the current check. Its own title, `[improvement](github-actions) Reduce redundant GitHub Actions runs and checkouts`, would not pass the checker it added. **Root cause.** #66957 replaced the `deepakputhraya/action-pr-title` action with an inline `grep -qE` and kept the action's regex verbatim, with the comment "Same regex as the previously used ... submodule". But that action is **JavaScript**, where `\-` inside a character class is a valid escape for a literal hyphen. **POSIX ERE has no such escape** — a backslash inside a bracket expression is just a backslash. So ``` [a-zA-Z0-9 \-_] ``` does not mean "letters, digits, space, hyphen, underscore". It makes `\` a member and then reads `-_` as a range endpoint, which leaves the hyphen itself out of the set. Porting the pattern from JS to `grep` silently changed its meaning. The fix puts the literal hyphen last in the bracket expression, which is how POSIX spells it: ```diff -if ! grep -qE '\[([a-zA-Z0-9 \-_])+\]\(([a-zA-Z0-9 \-_])+\)(.*)' <<< "${TITLE}"; then +if ! grep -qE '\[([a-zA-Z0-9 _-])+\]\(([a-zA-Z0-9 _-])+\)(.*)' <<< "${TITLE}"; then ``` A comment now records why the JS form cannot be restored verbatim, so the pattern is not "fixed back" later. #### 2. `.gitignore` ignores `.github` `.gitignore` has had a bare `.github` entry under its `# other` section since 9b5a464 (`[Feature][external catalog/lakesoul] support lakesoul catalog`, #32164) — a change that otherwise has nothing to do with CI and touched only those two `.gitignore` lines, so it looks accidental. The existing files under `.github` survived only because they were already tracked when the entry was added; `.gitignore` does not affect tracked files. The entry therefore has no useful effect today, and two harmful ones: * Any **new** file under `.github` — a workflow, an action, `CODEOWNERS`, an issue template — is silently ignored. `git status` does not list it and `git add` refuses it without `-f`, so it is easy to open a PR that is missing it. * Even for a **tracked** file, `git add .github/workflows/foo.yml` prints `The following paths are ignored by one of your .gitignore files` and exits non-zero, which breaks `git add ... && git commit ...` in scripts. This happened while preparing this very PR. ``` $ git check-ignore -v --no-index .github/workflows/new-thing.yml .gitignore:155:.github .github/workflows/new-thing.yml ```
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
FE Regression Coverage ReportIncrement line coverage |
924060929
approved these changes
Sep 4, 2026
16 tasks
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 problem does this PR solve?
Issue Number: close #67368
Related PR: #67381 (sibling fix in the same tracking series), #62259
Problem Summary:
A
UNIQUE KEYpoint query that qualifies for the short-circuit path returned no Flight endpoint over Arrow Flight SQL. The client failed withand the row was silently dropped. The identical query with
SET_VAR(enable_short_circuit_query=false)returned it on the same connection.Root cause — the short circuit produces no Arrow result at either end, and nothing prevented an Arrow Flight connection from planning one:
PointQueryExecutor, not aCoordinator, andCoordinator/NereidsCoordinatorare the only places that register aFlightSqlEndpointsLocation.StmtExecutor.executeAndSendResultthen returns early through its Arrow Flight branch with nothing registered and without ever callinggetNext(), soGetFlightInfofound an empty endpoint list.tablet_fetch_dataserializes withVMysqlResultWriterintoPTabletKeyLookupResponse.row_batchand runs no fragment, so theArrowFlightResultBlockBufferthatfetch_arrow_flight_schemalooks up by finst id never exists.LogicalResultSinkToShortCircuitPointQuerydid not look at the connect type, andenable_short_circuit_querydefaults totrue, so every ADBC / Arrow Flight JDBC point query on a MoW + light-schema-change +store_row_columntable hit this. Prepared statements go through the sameexecuteQueryStatementand failed identically.Fix — keep Arrow Flight SQL on the normal execution path.
This has to be decided at plan time rather than when picking the executor:
OlapScanNode.computeTabletInfoand several rewrite/property rules (ChildOutputPropertyDeriver,ShuffleKeyPruner,NestedColumnPruning,PruneOlapScanPartition) readStatementContext.isShortCircuitQuery()while the plan is being built, so flipping the flag later would run a coordinator over a plan shaped for a different execution mode. MySQL connections keep the short circuit unchanged.Returning the point-query result from the FE instead was considered and rejected for now:
FlightSqlChannel.addResultbuilds varchar vectors only, so every column would come back asUtf8, inconsistent with the normal Flight path. Full support (Arrow serialization in the BE lookup RPC plus a result buffer to hand out an endpoint) is a larger change and out of scope here.Also refreshes a now-stale comment in
StmtExecutorthat said point queries reach the Arrow Flight deferral gate.Release note
Fix Arrow Flight SQL returning no endpoint (
no FlightSqlEndpointsLocations) for a point query that hits the short-circuit path.Check List (For Author)
regression-test/suites/arrow_flight_sql_p0/test_point_query_over_arrow_flight.groovyuses the table from the issue and holds both a MySQL and an Arrow Flight connection. It asserts the MySQL explain still containsSHORT-CIRCUIT(so a table that stopped qualifying fails loudly instead of making the rest pass for the wrong reason), that the Flight explain does not, that both protocols return the same row, and that the numeric columns stay numeric over Flight.ShortCircuitPointQueryTest#testArrowFlightSqlConnectionDoesNotUseShortCircuitcovers the rule itself and re-asserts that the same statement still short circuits on a MySQL connection.Verified on a local single-FE + single-BE cluster, all three runs on the same cluster:
All suites success,Test 1 suites, failed 0the point query must not short circuit on an arrow flight connectionAll suites success,Test 1 suites, failed 0Run 2 is the negative control; the explain it captured is the bug itself, with a Flight result sink and the short circuit in one plan:
FE UT:
Tests run: 8, Failures: 0, Errors: 0forShortCircuitPointQueryTest.Behavior changed:
Does this need documentation?
🤖 Generated with Claude Code
https://claude.ai/code/session_017omcvWDsxEc9AyU83aBZ2g