-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
findColumn
and get*(String label)
methods.
The ResultSet `findColumn` methods (`BQForwardOnlyResultSet.findColumn`, `BQScrollableResultSet.findColumn`, and `BQResultSet.findColumn`) called `BQResultSetMetadata.getCatalogName` to determine the name of each column instead of `BQResultSetMetadata.getColumnLabel`. This was wrong because `getCatalogName` always returns the BigQuery project ID, not the column name. This bug in turn broke the get methods that are implemented in terms of `findColumn`, e.g. `getString(String)`. This change fixes `findColumn` and adds tests for methods that use it with some caveats: - `BQResultSet` has its findColumn fixed but it's not tested. That's because its unused, even by its tests, which request a `TYPE_SCROLL_INSENSITIVE` result set and thus get a `BQScrollableResultSet`. - `BQScrollableResultSet` only accepts dates and times that can be parsed as longs, which disagrees with the more widely used `BQForwardOnlyResultSet`. Its date and time accessors are uncovered. - `getBigDecimal` is excluded because it calls `BigDecimal.setScale` without a rounding mode, which no longer works in modern Java. A separate change can fix this.
- Loading branch information
Showing
6 changed files
with
331 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.