fix(bigquery): resultSet.getLong() does not truncate for large int64 values#13718
fix(bigquery): resultSet.getLong() does not truncate for large int64 values#13718mahitha-ada wants to merge 4 commits into
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 |
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