Skip to content

fix(bigquery-jdbc): fix manual commit mode failure for non-US regions#13285

Merged
lqiu96 merged 2 commits into
googleapis:mainfrom
yagudin10:main
May 28, 2026
Merged

fix(bigquery-jdbc): fix manual commit mode failure for non-US regions#13285
lqiu96 merged 2 commits into
googleapis:mainfrom
yagudin10:main

Conversation

@yagudin10
Copy link
Copy Markdown
Contributor

Problem

Manual commit mode fails when using BigQuery JDBC with non-US datasets.

STR (Steps to Reproduce)

  1. Create BigQuery JDBC connection
  2. Set a non-US location (e.g. EU) via Location property
  3. Enable session mode (EnableSession = 1)
  4. Disable auto-commit:
    conn.setAutoCommit(false);
  5. Execute a simple query:
SELECT 1;

ER (Expected Result)

  • Query executes successfully in manual commit mode
  • BigQuery uses configured Location (e.g. EU)
  • No region mismatch errors occur

AR (Actual Result)

Query execution fails with:

GoogleJsonResponseException: 400 Bad Request
INVALID_ARGUMENT
Error: 3848323

Sample java code:

String jdbcUrl = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443";

Properties props = new Properties();
props.put("OAuthType", "0");
props.put("OAuthPvtKeyPath", "<key-file-path>");
props.put("ProjectId", "<project-id>");
props.put("Location", "EU");
props.put("EnableSession", "1");

try (Connection conn = DriverManager.getConnection(jdbcUrl, props)) {
    conn.setAutoCommit(false);

    try (PreparedStatement ps = conn.prepareStatement("SELECT 1;")) {
        ps.execute();
    }
}

@yagudin10 yagudin10 requested review from a team as code owners May 28, 2026 10:08
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates BigQueryImpl.java to explicitly set the location for a new job using the configured options when generating a default JobId. This prevents jobs from being created with an incorrect location, such as when running in transaction mode outside the US. Additionally, telemetry tests in HttpBigQueryRpcTest.java have been updated to reflect the inclusion of the location in the job ID. No review comments were provided.

@logachev
Copy link
Copy Markdown
Contributor

/gcbrun

@logachev logachev changed the title Fix BigQuery JDBC manual commit mode region mismatch for non-US locations fix(bigquery-jdbc): fix manual commit mode failure for non-US regions May 28, 2026
Copy link
Copy Markdown
Contributor

@logachev logachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for finding & fixing this!

@lqiu96 lqiu96 requested review from jinseopkim0 and lqiu96 May 28, 2026 18:12
@lqiu96 lqiu96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 28, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 28, 2026
@jinseopkim0 jinseopkim0 requested a review from a team as a code owner May 28, 2026 18:41
@logachev
Copy link
Copy Markdown
Contributor

/gcbrun

@lqiu96 lqiu96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 28, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 28, 2026
@lqiu96 lqiu96 merged commit d28436c into googleapis:main May 28, 2026
183 checks passed
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.

5 participants