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

Support of Storage API #41

Closed
1 of 3 tasks
yan-hic opened this issue Oct 14, 2019 · 11 comments
Closed
1 of 3 tasks

Support of Storage API #41

yan-hic opened this issue Oct 14, 2019 · 11 comments
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@yan-hic
Copy link

yan-hic commented Oct 14, 2019

Any plan on supporting the bigquery storage api ?


Edit Sub-steps:

@tswast tswast added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Oct 14, 2019
@tswast
Copy link
Collaborator

tswast commented Oct 14, 2019

This requires adding support for the BigQuery Storage API to the DB-API adapter in google-cloud-bigquery, first.

I assume you want to improve the performance of downloading large results?

@yan-hic
Copy link
Author

yan-hic commented Oct 15, 2019

You are right on with your comment in https://github.com/googleapis/google-cloud-python/issues/9465, it is indeed to test/use with superset.

As a workaround, I can try pyodbc with the BQ ODBC driver.

@yan-hic
Copy link
Author

yan-hic commented Jun 9, 2020

@tswast does this close it ? : googleapis/python-bigquery#36 (comment)
If so, some documentation would be useful. Thanks

@tswast
Copy link
Collaborator

tswast commented Jun 15, 2020

It unblocks this feature from being completed, but doesn't quite fix it yet.

We need to update create_connect_args to (optionally) return a BQ Storage API client alongside the BQ client.

https://github.com/mxmzdlv/pybigquery/blob/f427dbe0040cbdf3681c1937699af0bea2b89af6/pybigquery/sqlalchemy_bigquery.py#L318

As I understand it, the return value of create_connect_args is passed to the BigQuery DB-API connect function.

This will also require adding a use_bqstorage_api option to the connection URL parsing logic https://github.com/mxmzdlv/pybigquery/blob/master/pybigquery/parse_url.py

@alonme
Copy link
Contributor

alonme commented Jun 19, 2020

Can you guys add some more details about the usage of this feature?
I would like to implement it, but i feel like i won't be able to do it in the best way possible and test that it works without understanding this issue a bit more

@yan-hic
Copy link
Author

yan-hic commented Jun 19, 2020

@alonme nothing to document since not implemented yet.
In the meantime you can use the standard way to read rows, with hope for the turbo mode soon.

@alonme
Copy link
Contributor

alonme commented Jun 19, 2020

Maybe I wasn't clear,
I would be happy to contribute this feature.
On order to do that, id like to understand it better

@tswast
Copy link
Collaborator

tswast commented Jun 24, 2020

@alonme Thank you for volunteering to help.

To verify the updates suggested in #41 (comment) make a query to table where the expected result set is moderately large (100 MB or more). When use_bqstorage_api=True is included in the connection string, you should notice a considerable (4-16x or more) speedup.

@alonme
Copy link
Contributor

alonme commented Jun 26, 2020

@tswast cool, got a PoC to work.
hope to get a nice branch for PR in the next days,
please assign to me

@tswast tswast added the api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. label Mar 23, 2021
@yan-hic
Copy link
Author

yan-hic commented Apr 7, 2021

closing as per #61 (comment)

@gallodustin
Copy link

Add a use_bqstorage_api option to the connection URL parsing logic.

Are there any plans to implement this feature as optional? My understanding is that using the storage API incurs an extra financial cost, so it would be nice to be able to disable it when desired.

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/python-bigquery-sqlalchemy API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants