Skip to content

feat(flight)!: expose prepared statement is_update - #12240

Draft
Phoenix500526 wants to merge 1 commit into
apache:mainfrom
Phoenix500526:issue/10082
Draft

Phoenix500526 wants to merge 1 commit into
apache:mainfrom
Phoenix500526:issue/10082

Conversation

@Phoenix500526

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Flight SQL servers can indicate whether a prepared statement should use the query or update execution path. Expose this information to Rust callers so they can choose the corresponding execution method without inferring it from the result schema.

What changes are included in this PR?

  • Sync the upstream optional is_update protobuf field and regenerate the Rust bindings.
  • Preserve the field in PreparedStatement and expose is_update() -> Option<bool>, with a documentation example showing caller-controlled execution.
  • Set Some(false) in the server example and retain None in the existing CLI test server.

Are these changes tested?

A client integration test verifies that Some(true), Some(false), and an absent field survive protobuf encoding, gRPC transport, and prepare(). The server example's test_select also checks the hint through UDS, HTTP, and HTTPS. The API documentation example is compile-tested.

The Flight unit, integration, CLI, and documentation tests pass, as do the server example tests with the documented flight-sql,tls-ring features. Workspace Clippy, formatting, and spelling checks pass. The full workspace test run stops in arrow-pyarrow because the local environment cannot load libpython3.12.dylib. Running the server example with all features also encounters a Rustls provider-selection conflict; the documented single-provider configuration passes.

Are there any significant user-facing changes?

Breaking Rust source API change: the public ActionCreatePreparedStatementResult struct gains pub is_update: Option<bool>. Downstream struct literals that enumerate its fields must initialize the new field, for example with is_update: None. This change needs the api-change label and a major-release merge window under the repository's compatibility policy.

The protobuf change is wire-compatible: absent fields remain None, and older clients can ignore the added field. The other new public API, PreparedStatement::is_update(&self) -> Option<bool>, is additive. Execution remains explicitly selected by the caller through the existing execute() and execute_update() methods.

AI usage disclosure

Codex assisted with the protocol and client changes, examples, tests, documentation, review, and PR preparation. Rust protobuf bindings were regenerated with the repository's generator.

@boring-cyborg boring-cyborg Bot added the arrow-flight Changes to the arrow-flight crate label Nov 13, 2026
@github-actions github-actions Bot added the api-change Breaking API change, needs to wait for a major version release label Nov 13, 2026
@Phoenix500526
Phoenix500526 force-pushed the issue/10082 branch 2 times, most recently from b944013 to aa08c81 Compare November 15, 2026 07:21
Clients need the server's execution hint to choose the query or update
path without inferring it from the result schema.

BREAKING CHANGE: ActionCreatePreparedStatementResult gains is_update.
Downstream struct literals must initialize this field, e.g. with None.
CLOSES apache#10082
@Rich-T-kid Rich-T-kid added enhancement New feature/addition next-major-release the PR has API changes and it waiting on the next major version labels Nov 16, 2026
@Phoenix500526

Copy link
Copy Markdown
Contributor Author

@Rich-T-kid Thanks for marking this for the next major release. I'll move this PR to draft for now and mark it ready for review once development opens for 61.0.0. I'll rebase and rerun the relevant tests at that point.

@Phoenix500526
Phoenix500526 marked this pull request as draft November 16, 2026 06:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change Breaking API change, needs to wait for a major version release arrow-flight Changes to the arrow-flight crate enhancement New feature/addition next-major-release the PR has API changes and it waiting on the next major version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update arrow-flight with is_update field

2 participants