fix(bigquery-jdbc): explicitly set location when available for temporary dataset#13508
fix(bigquery-jdbc): explicitly set location when available for temporary dataset#13508Neenu1995 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates BigQueryStatement to ensure that when a temporary dataset is created, its location is set to match the connection's location if specified. It also adds unit and integration tests to verify this behavior. The review feedback recommends wrapping the integration test cleanup in a try-catch block to prevent any deletion failures from masking the primary test failure.
| if (this.connection != null | ||
| && this.connection.getLocation() != null | ||
| && !this.connection.getLocation().isEmpty()) { | ||
| datasetInfoBuilder.setLocation(this.connection.getLocation()); |
There was a problem hiding this comment.
nit: we don't need all these checks. connection can't be null & if Location is null, so be it.. SDK will handle null Location the same way as no location.
E.g. we do it in executeJob()
| assertEquals(1, rs.getInt("val")); | ||
| } | ||
|
|
||
| Dataset dataset = bigQuery.getDataset(DatasetId.of(tempDatasetName)); |
There was a problem hiding this comment.
nit: should we validate that this dataset actually has data? (e.g. ensure that it is indeed the dataset that was used to write results to). Might require larger query
|
/gcbrun |
b/524850173