-
Notifications
You must be signed in to change notification settings - Fork 129
feat: new queryWithTimeout method for customer-side wait #3995
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
Conversation
b4cef6c to
a973a8d
Compare
ee3e7d0 to
736c2a1
Compare
|
Samples failures: Seems like the |
This seems to be unrelated, I see the same failure in another PR: #3982 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR. The clirr CI is failing with the following error:
Error: 7012: com.google.cloud.bigquery.BigQuery: Method 'public java.lang.Object queryWithTimeout(com.google.cloud.bigquery.QueryJobConfiguration, com.google.cloud.bigquery.JobId, java.lang.Long, com.google.cloud.bigquery.BigQuery$JobOption[])' has been added to an interface
Could you please add a default implementation to the queryWithTimeout method? An empty implementation throwing an exception would suffice.
Also, would it make sense to add @InternalApi annotation to this method?
1b9a8a5 to
d35054a
Compare
Existing
BigQuery.query()method always returns TableResult for both long-running a jobless queries.One of the issues with this approach is that for long-running operations, consumer app has no way to track the Job because JobId is unknown until after query is complete. It prevents consumer apps from cancelling queries if they're running too long or if customer wants to cancel jobs due various reasons.
This PR introduces new
queryWithTimeoutmethod that returns eitherTableResultobject for short queries orJobobject for long-running query.It will allow to manipulate
Jobbefore query is finished (can be relevant for queries that take more than a few minutes to complete).It also refactors
querymethods to leverage newqueryNoWaitmethod to avoid code duplication which fixed an issue thatquery()version withJobIdwas never leveraging jobless query feature.Added integration & unit test for new method covering timeout feature.