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

bigquery: consider moving from getQueryResults to listTableData #718

Closed
pongad opened this issue Oct 31, 2017 · 6 comments
Closed

bigquery: consider moving from getQueryResults to listTableData #718

pongad opened this issue Oct 31, 2017 · 6 comments
Assignees
Labels
api: bigquery Issues related to the BigQuery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@pongad
Copy link

pongad commented Oct 31, 2017

The current query method uses getQueryResults RPC to read rows of the results. However, benchmark shows that listTableData run significantly faster. Experiments in Go shows getQueryResults take 70% longer.

The choice of RPC is an implementation detail and can be changed whenever. However, listTableData returns fewer fields. In Java, we decided to tweak the API surface to make it easier to change RPC later. Of course, the change to API needs to happen before GA.

Will PHP require any API change?

@dwsupplee dwsupplee added api: bigquery Issues related to the BigQuery API. type: question Request for information or clarification. Not an issue. labels Oct 31, 2017
@pongad
Copy link
Author

pongad commented Nov 8, 2017

I believe this should be P1. If surface change is required, it needs to happen before GA.

@pongad pongad added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Nov 8, 2017
@dwsupplee
Copy link
Contributor

Hey @pongad,

It looks like the original direction we received from the BigQuery team was in fact to do exactly what you have suggested - however, that requirement was later dropped with a note stating getQueryResults is planned to be ported to one platform along with listTableData and that there would no longer be a required change. Do you know if this may have changed?

@pongad
Copy link
Author

pongad commented Nov 9, 2017

It's not a required change in the sense that things will still work if we don't change.

However, according to BigQuery team

getQueryResults will stay slower than listTableData for the near future

A part of this is somewhat fundamental: getQueryResults needs to do more work and therefore slower.

Let's imagine that

  • the client surface heavily relies on fields available to getQueryResults but not listTableData
  • we declare GA

We might want to make queries faster a few months from now, but then we can't since moving to listTableData would break people.

The P1 issue is to verify that we can swap the RPC later on. The actual swap doesn't need to happen right now.

Am I making any sense?

@dwsupplee
Copy link
Contributor

Yes, makes sense. Thanks for the extra explanation :).

If we move to using listTableData, is it safe to assume we retain the initial getQueryResults call in order to have access to the schema? If so, I believe we require no surface changes.

@pongad
Copy link
Author

pongad commented Nov 9, 2017

No problem!

Yes, we can keep using getQueryResults initially. I think we need to do that to wait for query to finish anyway.

Thank you for checking. Since this no longer blocks GA, I'll move this to P2 since we'll probably want to move at some point.

@pongad pongad added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Nov 9, 2017
@jdpedrie
Copy link
Contributor

jdpedrie commented Dec 8, 2017

Moving this to the new Feature Request wiki page.

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. priority: p2 Moderately-important priority. Fix may not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants