perf(bigquery-jdbc): eliminate dry run to resolve statement type - #14156
perf(bigquery-jdbc): eliminate dry run to resolve statement type#14156keshavdandeva wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors BigQueryStatement to retrieve the statement type and DML affected row count directly from the TableResult when available. This optimization avoids unnecessary dry runs and job retrievals during stateless query execution. Additionally, the test suite has been updated to remove obsolete dry-run mocks and includes new unit tests verifying that stateless query and DML executions behave as expected without triggering dry runs or job fetches. No review comments were provided, so there is no feedback to address.
028cbfa to
93c5552
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors BigQueryStatement to retrieve query statistics and statement types directly from TableResult when available, preventing unnecessary dry runs and getJob RPCs during stateless query execution. The review feedback suggests optimizing the DML row count extraction logic to avoid a redundant fallback to getQueryStatisticsFromJob when TableResult statistics are present but return null affected rows.
b/549675845
This PR eliminates the pre-execution dry-run query previously required to determine
StatementTypeduring query execution in the BigQuery JDBC driver.Changes
StatementTypeResolution: UpdatedBigQueryStatement.runQuery()to extractStatementTypedirectly fromTableResult(for stateless/jobless queries) orJobStatistics(for job-based queries), removing the dry-run query fallback.BigQueryStatement.handleQueryResult()to retrievenumDmlAffectedRowsdirectly fromTableResult, avoiding extragetJob()polling RPCs for DML statements.BigQueryStatementTestverifying thatbigquery.create()andbigquery.getJob()are never invoked during stateless query and DML executions.