Skip to content

fix(bigquery): resultSet.getLong() does not truncate for large int64 values#13718

Merged
lqiu96 merged 11 commits into
googleapis:mainfrom
mahitha-ada:fix-bigquery-getlong-int64
Jul 22, 2026
Merged

fix(bigquery): resultSet.getLong() does not truncate for large int64 values#13718
lqiu96 merged 11 commits into
googleapis:mainfrom
mahitha-ada:fix-bigquery-getlong-int64

Conversation

@mahitha-ada

Copy link
Copy Markdown
Contributor

Fixes #12938

This fixes BigQueryResultImpl.ResultSet#getLong(int) for Read API rows. The index-based getter previously delegated to getInt(String), which truncated large INT64 values and could return negative results.

A regression test now verifies that getLong(int) preserves a value larger than Integer.MAX_VALUE.

Tests:

  • mvn -pl java-bigquery/google-cloud-bigquery -Dtest=BigQueryResultImplTest -DskipITs=true test

@mahitha-ada
mahitha-ada requested review from a team as code owners July 9, 2026 13:22
@google-cla

google-cla Bot commented Jul 9, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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

Copy link
Copy Markdown
Contributor

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 fixes a bug in BigQueryResultImpl.getLong(int columnIndex) where it incorrectly called getInt instead of getLong when retrieving data from the Read API (Arrow), which could lead to truncation of 64-bit integer values. A unit test has been added to verify that large INT64 values are correctly preserved when retrieved by column index. There are no review comments, so no feedback is provided.

@lqiu96 lqiu96 changed the title fix: preserve BigQuery getLong int64 values fix(bigquery): resultSet.getLong() does not truncate for large int64 values Jul 9, 2026
@lqiu96 lqiu96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 9, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 9, 2026
@lqiu96 lqiu96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 9, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 9, 2026
@lqiu96

lqiu96 commented Jul 9, 2026

Copy link
Copy Markdown
Member

/gcbrun

@mahitha-ada

Copy link
Copy Markdown
Contributor Author

Thanks for the approval and for triggering the checks. The multi-approvers check now reports 1 of 2 required internal approvals, and the remaining BigQuery/JDBC presubmits require internal action. Could you route this to a second approver or trigger the remaining checks when convenient? Happy to address anything needed from my side.

@logachev

Copy link
Copy Markdown
Contributor

/gcbrun

@mahitha-ada

Copy link
Copy Markdown
Contributor Author

/gcbrun

Thanks @logachev for the second approval. I synchronized with main after the previous /gcbrun, which reset the internal BigQuery and JDBC presubmits. The PR is currently mergeable and the multi-approvers check is passing. Could you please run /gcbrun once more when convenient? I will leave the branch unchanged unless another update is required.

@keshavdandeva

Copy link
Copy Markdown
Contributor

/gcbrun

@mahitha-ada

Copy link
Copy Markdown
Contributor Author

@logachev @lqiu96 @keshavdandeva The branch is now synchronized with main and the PR remains approved. Could you please run /gcbrun and merge it once green, or add the appropriate automerge label? main is moving frequently, so repeated manual updates keep resetting the presubmits. Thank you.

@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 Jul 22, 2026
@lqiu96
lqiu96 enabled auto-merge (squash) July 22, 2026 15:20
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 22, 2026
@lqiu96
lqiu96 merged commit bc19822 into googleapis:main Jul 22, 2026
212 of 214 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.

[google-cloud-bigquery] getLong(int) in BigQueryResultImpl returns int

5 participants