Skip to content

chore: removing dry run for queries without positional params - #1654

Open
sachinpro wants to merge 2 commits into
mainfrom
removing_dry_run
Open

sachinpro wants to merge 2 commits into
mainfrom
removing_dry_run

Conversation

@sachinpro

@sachinpro sachinpro commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

b/553446481

Context

Previously, SQLExecDirect always invoked PrepareQuery(query_str) prior to execution. PrepareQuery performs a dry run API call against BigQuery to retrieve query metadata (schema for the IRD, statement type, and job location).

This PR bypasses the dry run call during SQLExecDirect for simple queries without positional or named parameters, populating the IRD directly from the execution response.

Key Changes:

  1. Bypass Dry Run in SQLExecDirect:

    • SQLExecDirect now executes queries directly via ActuallyProcessExecute when no parameter bindings exist
  2. Response-Driven Statement & Descriptor Handling:

    • Updated google-cloud-cpp to v3.10.0 which exposes statement_type directly in PostQueryResults from the jobs.query response.
    • Implementation Row Descriptor (IRD) is populated dynamically based on the returned response schema and query statement type (binding for SELECT result sets, unbinding for DDL/DML).
  3. Multi-Statement Script Refactoring:

    • Added PopulateScriptChildJobs to handle multi-statement scripts (SCRIPT), properly listing and ordering child jobs and resetting to the first statement's result set.
    • Refactored ExecuteScript to share the child-job enumeration and single-statement handling logic with PopulateScriptChildJobs.

    Verification

    1. GHA checks are passing.
    2. Perf benchmarking results proves that this change doesn't degrade performance.

@sachinpro
sachinpro force-pushed the removing_dry_run branch 2 times, most recently from 7ae79f3 to c50e696 Compare September 9, 2026 20:03
@sachinpro
sachinpro force-pushed the removing_dry_run branch 6 times, most recently from fb857e5 to cafdc11 Compare September 10, 2026 00:18
@sachinpro
sachinpro force-pushed the removing_dry_run branch 6 times, most recently from 98ce628 to 748de25 Compare September 10, 2026 04:30
@sachinpro
sachinpro marked this pull request as ready for review September 10, 2026 04:56
@sachinpro
sachinpro requested a review from a team as a code owner September 10, 2026 04:56
@sachinpro
sachinpro force-pushed the removing_dry_run branch 4 times, most recently from ff1e699 to 26001fb Compare September 11, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant