GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Implement missing features and fix found bugs for BigQuery Client Library by vam-google · Pull Request #2446 · googleapis/google-cloud-java Conversation
|
|
@vkedia please review spanner's |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is a little big for me to properly review, but I don't see anything wrong apart from a couple of nits noted.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return option instanceof RetryOption ? (RetryOption) option : null; | ||
| } | ||
|
|
||
| public static QueryResultsOption[] filterQueryResutlsOptions(QueryOption... options) { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| String cursor = result.x(); | ||
| return new PageImpl<>(new TableDataPageFetcher(tableId, serviceOptions, cursor, optionsMap), | ||
| cursor, transformTableData(result.y())); | ||
| cursor, transformTableData(result.y(), null)); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| response = bigquery.getQueryResults(response.getJobId()); | ||
| } | ||
| QueryJobConfiguration queryConfig = | ||
| QueryJobConfiguration.newBuilder(query).setUseLegacySql(true).build(); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // [START runQueryWithParameters] | ||
| QueryRequest request = QueryRequest.newBuilder(query) | ||
| QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(query) | ||
| .setUseLegacySql(false) // standard SQL is required to use query parameters |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| .setPageSize(1000L) | ||
| .build(); | ||
| QueryJobConfiguration queryConfig = | ||
| QueryJobConfiguration.newBuilder("SELECT * FROM my_dataset_id.my_table_id").build(); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (!(prevThrowable instanceof SpannerException)) { | ||
| return ((BaseServiceException) prevThrowable).isRetryable(); | ||
| } | ||
| return ((SpannerException) prevThrowable).getErrorCode() != ErrorCode.NOT_FOUND; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| this.type = checkNotNull(type); | ||
| return this; | ||
| public Builder setType(LegacySQLTypeName type, Field... subFields) { | ||
| return setType(type, subFields.length > 0 ? Fields.of(subFields) : null); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ImmutableMap.Builder<String, Integer> nameIndexBuilder = ImmutableMap.builder(); | ||
| int index = 0; | ||
| for (Field field : fields) { | ||
| nameIndexBuilder.put(field.getName(), index++); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @Test | ||
| public void testFromPb() { | ||
| FieldValue value = FieldValue.fromPb(BOOLEAN_FIELD); | ||
| FieldValue value = FieldValue.fromPb(BOOLEAN_FIELD, null); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return !prevResponse.getDone(); | ||
| } | ||
| if (prevThrowable instanceof BaseServiceException) { | ||
| if (!(prevThrowable instanceof SpannerException)) { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The logic was simplified and modified to match exactly the original one. Note, this does not allow to retry on any retriable BaseServiceExceptions, if they are not SpannerException (on practice here each BaseServiceException is always also a SpannerException).
|
Addressed review feedback. PTAL. @vkedia I fixed the retry logic (sorry for for breaking it). Hopefully now it is correct (matches exactly the original one in functionality). Please note that it theoretically may refuse to retry a retriable BaseServiceException, which is retriable but is not a SpannerException. This is only a theoretical concern, since all BaseServiceExceptions in this context will always be SpanneExceptions too. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return option instanceof RetryOption ? (RetryOption) option : null; | ||
| } | ||
|
|
||
| public static QueryResultsOption[] filterQueryResutlsOptions(QueryOption... options) { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * String query = "SELECT distinct(corpus) FROM `bigquery-public-data.samples.shakespeare`"; | ||
| * QueryJobConfiguration queryConfig = QueryJobConfiguration.of(query); | ||
| * | ||
| * // To run the legacy syntax queries use the following code instead: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * may or may not contain related schema. If schema is not provided, the individual cells of the row | ||
| * will still be accessible by index but not by name. | ||
| */ | ||
| public class FieldValues extends AbstractList<FieldValue> implements Serializable { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * Google BigQuery Table schema fields (columns). Each field has a unique name and index. Fields | ||
| * with duplicate names are not allowed in BigQuery schema. | ||
| */ | ||
| public final class Fields extends AbstractList<Field> implements Serializable { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
LGTM |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…rary (#2446) 0) Access query results row cells by name. Now `row.get(1)` and `get("firstColumnName")` are supported (currently supported only for results returned by `BigQuery.query()` and not supported by results returned `BigQuery.listTableData()` because there is no schema and it would require additional request to the server to get schema (but still can be added in the future easily with cost of an extra network call)). Same syntax is supported for record-type fields (i.e. nested fields can be accessed by name too). 1) Refactor `BigQuery.query()` to use `jobs.insert/jobs.getQueryResults` combination instead of `jobs.query`. `QueryRequest` class was removed, now `query()` method directly accepts `QueryJobConfiguration` instead. The remaining properties of removed `QueryRequest` class now are passed in a form of `QueryOption` vararg argument. `QueryOption` combines query and waiting options (waiting options are necessary because query() is now waiting for query to complete). 2) Make `BigQuery.query()` call synchronous (waits for query completion before return result), with jittered exponential backoff for polling (based on `gax.retrying` package) 3) Add client side job id generation (`JobId.of()`) 4) Replace `WaitForOption` with `RetryOption` (based on `RetrySettings` and is consistent with the rest of the codebase). This affected compute and spanner clients too. 5) Rewrite `Job.wait()` to use jittered exponentiall backoff polling (based on`gax.retrying` package). Polling is performed differently depending on the type of job: for query jobs on each poll `getQueryResults()` is called, for all other job types `getJob()` is used instead. 6) Use standard SQL as default for all queries 7) Fix wrong query results iteration samples code used all over the place in documentation. 8) Various smaller changes/refactorings
…o v1-rev20240311-2.0.0 (#2446)
…rary (#2446) 0) Access query results row cells by name. Now `row.get(1)` and `get("firstColumnName")` are supported (currently supported only for results returned by `BigQuery.query()` and not supported by results returned `BigQuery.listTableData()` because there is no schema and it would require additional request to the server to get schema (but still can be added in the future easily with cost of an extra network call)). Same syntax is supported for record-type fields (i.e. nested fields can be accessed by name too). 1) Refactor `BigQuery.query()` to use `jobs.insert/jobs.getQueryResults` combination instead of `jobs.query`. `QueryRequest` class was removed, now `query()` method directly accepts `QueryJobConfiguration` instead. The remaining properties of removed `QueryRequest` class now are passed in a form of `QueryOption` vararg argument. `QueryOption` combines query and waiting options (waiting options are necessary because query() is now waiting for query to complete). 2) Make `BigQuery.query()` call synchronous (waits for query completion before return result), with jittered exponential backoff for polling (based on `gax.retrying` package) 3) Add client side job id generation (`JobId.of()`) 4) Replace `WaitForOption` with `RetryOption` (based on `RetrySettings` and is consistent with the rest of the codebase). This affected compute and spanner clients too. 5) Rewrite `Job.wait()` to use jittered exponentiall backoff polling (based on`gax.retrying` package). Polling is performed differently depending on the type of job: for query jobs on each poll `getQueryResults()` is called, for all other job types `getJob()` is used instead. 6) Use standard SQL as default for all queries 7) Fix wrong query results iteration samples code used all over the place in documentation. 8) Various smaller changes/refactorings
…v3.49.0 (#2446) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:sdk-platform-java-config](https://redirect.github.com/googleapis/java-shared-config) | `3.48.0` -> `3.49.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/java-pubsub). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4zMy42IiwidXBkYXRlZEluVmVyIjoiNDAuMzMuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
🤖 I have created a release *beep* *boop* --- ## [1.140.0](https://togithub.com/googleapis/java-pubsub/compare/v1.139.4...v1.140.0) (2025-06-03) ### Features * Add SchemaViolationReason to IngestionFailureEvent ([21cc376](https://togithub.com/googleapis/java-pubsub/commit/21cc3764aaa6fc05eb4a5078a72dae30694fba91)) ### Dependencies * Update dependency com.google.cloud:google-cloud-bigquery to v2.50.1 ([#2435](https://togithub.com/googleapis/java-pubsub/issues/2435)) ([b37c557](https://togithub.com/googleapis/java-pubsub/commit/b37c5573e1d0d7eada4ce4ec6a052521ea11cff1)) * Update dependency com.google.cloud:google-cloud-storage to v2.52.3 ([#2436](https://togithub.com/googleapis/java-pubsub/issues/2436)) ([4f309d1](https://togithub.com/googleapis/java-pubsub/commit/4f309d151d4bd584a33a0bb8882d0614a1b9d533)) * Update dependency com.google.cloud:sdk-platform-java-config to v3.49.0 ([#2444](https://togithub.com/googleapis/java-pubsub/issues/2444)) ([a59135c](https://togithub.com/googleapis/java-pubsub/commit/a59135c6859d0aa5c247a6a1f60872c959123cc7)) * Update dependency com.google.cloud:sdk-platform-java-config to v3.49.0 ([#2446](https://togithub.com/googleapis/java-pubsub/issues/2446)) ([6434be1](https://togithub.com/googleapis/java-pubsub/commit/6434be16560fdc8797b7c930b06df38c0972c96c)) * Update dependency com.google.protobuf:protobuf-java-util to v4.31.0 ([#2430](https://togithub.com/googleapis/java-pubsub/issues/2430)) ([232fac1](https://togithub.com/googleapis/java-pubsub/commit/232fac1c47e0d3680dcc8d56b69d65ed0d379dde)) * Update googleapis/sdk-platform-java action to v2.59.0 ([#2445](https://togithub.com/googleapis/java-pubsub/issues/2445)) ([12d4cfb](https://togithub.com/googleapis/java-pubsub/commit/12d4cfb7d67dbb163b3a545ea2ebae450e88283d)) ### Documentation * **sample:** Update the subscribe with error listener and subscribe with exactly-once samples ([#2437](https://togithub.com/googleapis/java-pubsub/issues/2437)) ([17c142b](https://togithub.com/googleapis/java-pubsub/commit/17c142b20efb79f9c71fc6306cb3ee4e15c5e06f)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
…v3.49.0 (#2446) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:sdk-platform-java-config](https://redirect.github.com/googleapis/java-shared-config) | `3.48.0` -> `3.49.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/java-pubsub). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4zMy42IiwidXBkYXRlZEluVmVyIjoiNDAuMzMuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
🤖 I have created a release *beep* *boop* --- ## [1.140.0](https://togithub.com/googleapis/java-pubsub/compare/v1.139.4...v1.140.0) (2025-06-03) ### Features * Add SchemaViolationReason to IngestionFailureEvent ([0b671f4](https://togithub.com/googleapis/java-pubsub/commit/0b671f423f454cbf200a39bc60aea2e2cf74607d)) ### Dependencies * Update dependency com.google.cloud:google-cloud-bigquery to v2.50.1 ([#2435](https://togithub.com/googleapis/java-pubsub/issues/2435)) ([fb40c61](https://togithub.com/googleapis/java-pubsub/commit/fb40c61310f1d9895c6fa881b8fc601d7b7ae1b7)) * Update dependency com.google.cloud:google-cloud-storage to v2.52.3 ([#2436](https://togithub.com/googleapis/java-pubsub/issues/2436)) ([6555801](https://togithub.com/googleapis/java-pubsub/commit/6555801527273742c6b26c0da8a5590bd8083a6f)) * Update dependency com.google.cloud:sdk-platform-java-config to v3.49.0 ([#2444](https://togithub.com/googleapis/java-pubsub/issues/2444)) ([3f21786](https://togithub.com/googleapis/java-pubsub/commit/3f21786df7c78c85b07661447914a97bb646f2b1)) * Update dependency com.google.cloud:sdk-platform-java-config to v3.49.0 ([#2446](https://togithub.com/googleapis/java-pubsub/issues/2446)) ([8ea9d93](https://togithub.com/googleapis/java-pubsub/commit/8ea9d93da1b9af8b9c0cbcbf7d6193ed1e90675b)) * Update dependency com.google.protobuf:protobuf-java-util to v4.31.0 ([#2430](https://togithub.com/googleapis/java-pubsub/issues/2430)) ([325493d](https://togithub.com/googleapis/java-pubsub/commit/325493d850cd1258d1b300f6d9b04023c164f966)) * Update googleapis/sdk-platform-java action to v2.59.0 ([#2445](https://togithub.com/googleapis/java-pubsub/issues/2445)) ([a4ccf1a](https://togithub.com/googleapis/java-pubsub/commit/a4ccf1afeecbe1e682abe9c98a54332b0fdd1794)) ### Documentation * **sample:** Update the subscribe with error listener and subscribe with exactly-once samples ([#2437](https://togithub.com/googleapis/java-pubsub/issues/2437)) ([bc8c696](https://togithub.com/googleapis/java-pubsub/commit/bc8c696d65d59196a33bd0b49cae4f4110b70633)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.