Skip to content

chore: response-driven SQLExecDirect execution - #1660

Draft
sachinpro wants to merge 2 commits into
mainfrom
removing_dry_run_test
Draft

sachinpro wants to merge 2 commits into
mainfrom
removing_dry_run_test

Conversation

@sachinpro

@sachinpro sachinpro commented Sep 11, 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 changed the title [TEST DRAFT] chore: response-driven SQLExecDirect execution chore: response-driven SQLExecDirect execution Sep 11, 2026
@sachinpro
sachinpro force-pushed the removing_dry_run_test branch 6 times, most recently from 6923537 to b6f0763 Compare September 15, 2026 23:01
@sachinpro
sachinpro force-pushed the removing_dry_run_test branch 3 times, most recently from 09597c7 to ef6e3c3 Compare September 15, 2026 23:23
@sachinpro
sachinpro force-pushed the removing_dry_run_test branch 4 times, most recently from 1499177 to 67da40a Compare September 16, 2026 00:11
@sachinpro
sachinpro force-pushed the removing_dry_run_test branch 2 times, most recently from 7a290d3 to 3dc3c86 Compare September 16, 2026 00:22
@sachinpro
sachinpro force-pushed the removing_dry_run_test branch from 3dc3c86 to 6ddb426 Compare September 16, 2026 00:42
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