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

Java SDK: getQuery overload that enables RPC call does not make jobId available to caller #1592

Closed
jeff303 opened this issue Sep 17, 2021 · 1 comment
Assignees
Labels
api: bigquery Issues related to the googleapis/java-bigquery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@jeff303
Copy link

jeff303 commented Sep 17, 2021

Is your feature request related to a problem? Please describe.
When using the com.google.cloud.bigquery.BigQueryImpl#query(com.google.cloud.bigquery.QueryJobConfiguration, com.google.cloud.bigquery.BigQuery.JobOption...) overload, the randomly generated jobId is not available to the caller. This means that, in practice, the caller can't cancel this job without using reflection.

The version of query that accepts the jobId parameter (meaning, the caller can supply it) can't use the RPC/fast path.

Describe the solution you'd like
Either the query overload accepting the jobId should allow the RPC/fast path, or else the generated jobId should be made available somehow to the caller via the TableResult (perhaps a .getJobReference method).

Describe alternatives you've considered
Using reflection to access private methods or fields that would be necessary to implement cancellation behavior on the caller side.

Additional context
We would like to be able to both cancel queries (to save user cost/resources) and use the fast RPC path.

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/java-bigquery API. label Sep 17, 2021
@stephaniewang526 stephaniewang526 self-assigned this Sep 20, 2021
@stephaniewang526 stephaniewang526 added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Sep 20, 2021
@stephaniewang526
Copy link
Contributor

Hi, thank you for the feedback. We definitely do not plan on exposing jobId to the user since not all query operations are jobs -- only long running ones will have a jobId/jobReference generated. We are working on a set of query API changes (sneak peak). The cancel method will be on the Connection interface. That should address this problem. It will be coming soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/java-bigquery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants