Skip to content

spanner: re-evaluate the design choice for execute_query not fetching the first PartialResultSet #5685

@olavloite

Description

@olavloite

The execute_query method in the Spanner client invokes the ExecuteStreamingSql RPC in Spanner. This initiates the gRPC stream that will receive the query results from Spanner. However, Spanner does not evaluate the query at all before setting up this stream, meaning that even the simplest syntax error will be delayed until the first time the application calls ResultSet#next().

Possible alternatives:

  • Keep it as it is now.
  • Delay the initialization of the stream until the first time ResultSet#next() is called.
  • Eagerly fetch the first PartialResultSet when execute_streaming is called to ensure that execute_query fully validates and executes the query.

The Spanner emulator does evaluate the query when ExecuteStreamingSql is invoked. This currently causes a behavioral difference when using the Rust client with the Emulator vs with real Spanner.

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the Spanner API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions