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

feature request: query without having to provide a jobid ? #3209

Closed
c0b opened this issue Mar 27, 2017 · 4 comments
Closed

feature request: query without having to provide a jobid ? #3209

c0b opened this issue Mar 27, 2017 · 4 comments
Assignees
Labels
api: bigquery Issues related to the BigQuery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@c0b
Copy link

c0b commented Mar 27, 2017

i'm reading the google-cloud-python docs and the bigquery rest api reference [2], the job insert api is the async query job, I wonder why the python api is designed to have to provide a jobid? since bigquery server side is archiving the job id for a long time can't re-use same id, that has imposed client side a burden to maintain every jobid to be unique, although that can be easily archived by a time and random based id generator, but the point is: if the bottom layer rest api reference [2] doesn't require jobid to be provided, in the case when jobid is omitted, bigquery server will allocate a unique jobid; why the Python api becomes requiring a jobid?

  1. https://googlecloudplatform.github.io/google-cloud-python/stable/bigquery-usage.html#querying-data-asynchronous
  2. https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs
@daspecster daspecster added the api: bigquery Issues related to the BigQuery API. label Mar 27, 2017
@tseaver tseaver added the type: question Request for information or clarification. Not an issue. label Mar 27, 2017
@tseaver
Copy link
Contributor

tseaver commented Mar 27, 2017

@c0b thanks for the report. AFAICT, the docs for the jobReference element of a job resource say that jobId is a required field. The "managing jobs" docs state that supplying a job ID is best practice:

If you call jobs.insert without specifying a job ID, BigQuery will create a job ID for you, but you will not be able to check the status of that job until the call returns. Moreover, it may be difficult to tell whether the job was successfully inserted or not. If you use your own job ID, you can check the status of the job at any time and you can retry on the same job ID to ensure that the job starts exactly one time.

@lukesneeringer
Copy link
Contributor

The client library can totally solve for this by generating a job ID (e.g. str(uuid.uuid4())), saving it to the object, and using it.

@c0b
Copy link
Author

c0b commented Mar 29, 2017

the docs for the jobReference element of a job resource say that jobId is a required field.

the jobId is only required if jobReference is present; but the jobReference itself is optional;

@lukesneeringer lukesneeringer added priority: p2 Moderately-important priority. Fix may not be included in next release. status: acknowledged type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed type: question Request for information or clarification. Not an issue. labels Apr 4, 2017
@lukesneeringer lukesneeringer removed the priority: p2 Moderately-important priority. Fix may not be included in next release. label Aug 9, 2017
@tswast
Copy link
Contributor

tswast commented Aug 11, 2017

Tracking this internally as part of GA redesign.

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 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

5 participants