Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code snippet error - response.getResult returns nullptr if job not completed. #570

Closed
cobookman opened this issue Mar 18, 2017 · 2 comments
Assignees

Comments

@cobookman
Copy link
Contributor

cobookman commented Mar 18, 2017

In which file did you encounter the issue?

https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/bigquery/cloud-client/src/main/java/com/example/bigquery/SimpleApp.java#L53

Did you change the file? If so, how?

while (!response.jobCompleted()) {
  Thread.sleep(1000);
  response = bigquery.getQueryResults(response.getJobId());
}
List<BigQueryError> executionErrors = response.getExecutionErrors();
// look for errors in executionErrors
QueryResult result = response.getResult();

Describe the issue

response.getResult() will return with a nullptr if the job has not completed yet. It does not block until job is completed.

http://googlecloudplatform.github.io/google-cloud-java/0.5.0/apidocs/com/google/cloud/bigquery/QueryResponse.html#getResult()

@lesv
Copy link
Contributor

lesv commented Mar 19, 2017

@tswast PTAL

@tswast
Copy link
Contributor

tswast commented Mar 20, 2017

The behavior of the .query() method is confusing since it can sometimes return results, and sometimes you have to poll as you describe.

You're correct that we should always poll in the samples since that is likely to be needed. I'll update this one today.

Related: googleapis/google-cloud-java#1588 I've proposed to the client library team that we don't use .query() without an explicit JobID anywhere.

averikitsch pushed a commit that referenced this issue Oct 27, 2022
…uration to v1.2.0 (#570)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud.samples:shared-configuration](https://github.com/GoogleCloudPlatform/java-repo-tools) | `1.0.23` -> `1.2.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/compatibility-slim/1.0.23)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/confidence-slim/1.0.23)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>GoogleCloudPlatform/java-repo-tools</summary>

### [`v1.2.0`](https://github.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.24...v1.2.0)

[Compare Source](https://github.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.24...v1.2.0)

### [`v1.0.24`](https://github.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.23...v1.0.24)

[Compare Source](https://github.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.23...v1.0.24)

</details>

---

### Configuration

📅 **Schedule**: 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, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-tasks).
averikitsch pushed a commit that referenced this issue Nov 1, 2022
…uration to v1.2.0 (#570)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud.samples:shared-configuration](https://github.com/GoogleCloudPlatform/java-repo-tools) | `1.0.23` -> `1.2.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/compatibility-slim/1.0.23)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/confidence-slim/1.0.23)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>GoogleCloudPlatform/java-repo-tools</summary>

### [`v1.2.0`](https://github.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.24...v1.2.0)

[Compare Source](https://github.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.24...v1.2.0)

### [`v1.0.24`](https://github.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.23...v1.0.24)

[Compare Source](https://github.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.23...v1.0.24)

</details>

---

### Configuration

📅 **Schedule**: 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, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-tasks).
Sita04 pushed a commit that referenced this issue Feb 7, 2023
🤖 I have created a release \*beep\* \*boop\*
---
### [2.4.4](https://www.github.com/googleapis/java-dlp/compare/v2.4.3...v2.4.4) (2021-07-02)


### Bug Fixes

* Add `shopt -s nullglob` to dependencies script ([#570](https://www.github.com/googleapis/java-dlp/issues/570)) ([a48d010](https://www.github.com/googleapis/java-dlp/commit/a48d0100ece21f77bf0a097668c6b928901bb97e))
* Update dependencies.sh to not break on mac ([#565](https://www.github.com/googleapis/java-dlp/issues/565)) ([b50633b](https://www.github.com/googleapis/java-dlp/commit/b50633bb19291cffce6397e687c5ceb70cb4d425))


### Dependencies

* update dependency com.google.cloud:google-cloud-pubsub to v1.113.4 ([#569](https://www.github.com/googleapis/java-dlp/issues/569)) ([2f56edd](https://www.github.com/googleapis/java-dlp/commit/2f56eddaf8c2083ea243554703532e93c111a6d5))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#574](https://www.github.com/googleapis/java-dlp/issues/574)) ([31110da](https://www.github.com/googleapis/java-dlp/commit/31110da3cdce9882bb98d14adc49196050ac21dd))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants