Skip to content

GH-49497: [FlightRPC] Add is_update field to ActionCreatePreparedStatementResult#49498

Draft
ennuite wants to merge 1 commit intoapache:mainfrom
ennuite:add-is-update-field
Draft

GH-49497: [FlightRPC] Add is_update field to ActionCreatePreparedStatementResult#49498
ennuite wants to merge 1 commit intoapache:mainfrom
ennuite:add-is-update-field

Conversation

@ennuite
Copy link
Copy Markdown

@ennuite ennuite commented Mar 11, 2026

Rationale for this change

Multiple database driver APIs have functions that allow for executing prepared statements that can be either result set generating queries or update commands. Before this PR, there was no way for servers to indicate whether the query should be executed with CommandPreparedStatementUpdate or CommandPreparedStatementQuery.

What changes are included in this PR?

The change in this PR introduces a new field set by the server after creation of the prepared statement to indicate the proper network flow.

Are these changes tested?

No, because these changes are best tested using a database driver but this PR includes only changes to the proto definition.

Are there any user-facing changes?

No.

@github-actions github-actions Bot added the awaiting review Awaiting review label Mar 11, 2026
prmoore77 added a commit to gizmodata/gizmosql-jdbc-driver that referenced this pull request Apr 24, 2026
### Added
- `DatabaseMetaData.getIndexInfo()` now returns real index rows (DuckDB
  backend), via the server's new `_gizmosql_system.main.gizmosql_index_info`
  catalog view (GizmoSQL v1.22.0) with inline-`duckdb_indexes()` fallback
  for older servers and a clear "SQLite backend not supported" error
  otherwise.
- New non-standard `ArrowFlightConnection.getViewDefinition(cat, schema, v)`
  method for retrieving CREATE VIEW DDL text (same three-tier fallback).
- `Statement.execute()` now reports a valid `getUpdateCount()` for
  INSERT/UPDATE/DELETE/DDL: `ArrowFlightMetaImpl.prepareAndExecute` sniffs
  the leading SQL keyword (with comment stripping) and routes DML through
  `DoPutCommandStatementUpdate`. Keyword set kept in sync with the ADBC
  Python driver. A TODO in source points at apache/arrow#49498 to adopt
  the authoritative `is_update` protocol field once it lands upstream.

### Tests
- New unit tests in `ArrowFlightMetaImplTest` for the keyword heuristic.
- New integration tests in `GizmoSqlIntegrationIT` for decimal round-trip,
  `getIndexInfo`, `getViewDefinition`, and DML update counts.
- Upstream `ArrowDatabaseMetadataTest#testGetIndexInfo` (which asserted
  stock empty-result behavior) renamed to
  `testGetIndexInfoAgainstNonGizmosqlServerThrows` to match the new
  contract (driver now throws on non-GizmoSQL Flight SQL servers).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review Awaiting review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant