fix(bigquery): resultSet.getLong() does not truncate for large int64 values#13718
Conversation
|
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. |
There was a problem hiding this comment.
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.
|
/gcbrun |
|
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. |
|
/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. |
|
/gcbrun |
|
@logachev @lqiu96 @keshavdandeva The branch is now synchronized with |
|
/gcbrun |
Fixes #12938
This fixes
BigQueryResultImpl.ResultSet#getLong(int)for Read API rows. The index-based getter previously delegated togetInt(String), which truncated large INT64 values and could return negative results.A regression test now verifies that
getLong(int)preserves a value larger thanInteger.MAX_VALUE.Tests:
mvn -pl java-bigquery/google-cloud-bigquery -Dtest=BigQueryResultImplTest -DskipITs=true test