You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Is your feature request related to a problem? Please describe.
Getting data out of the DB-API can be slow for large results, especially if the desired format is Arrow, as is the case in polars (pola-rs/polars#18547, pola-rs/polars#17326)
A (better?) alternative would be for BigQuery to provide a real C/C++ ADBC driver, which could then be automatically usable from the Python adbc_driver_manager package.
Additional context
I'm not expecting fast movement here, as the ADBC standard/community still feels pretty early days but figured it was worth filing for visibility given that polars is integrated with it.
A (better?) alternative would be for BigQuery to provide a real C/C++ ADBC driver, which could then be automatically usable from the Python adbc_driver_manager package.
I'm unsure if you're aware, but it looks like BigQuery does have ADBC drivers implemented in C# and Go. Python wheels were included for the first time in the recent release.
There is still a fair bit to be desired (including a page in the docs), with a to do list outlined here.
Currently, new drivers can be written in C#, C/C++, Go, and Java. A driver written in C/C++ or Go can be used from either of those languages, as well as C#, Python, R, and Ruby. (C# can experimentally export drivers to the same set of languges as well.)
I haven't installed or tested anything - just observations. Just figured I would give a heads up on it.
After some tinkering with the low-level API I've also figured out how to read data directly into Polars without PyArrow or the BigQuery client libraries.
This is thanks to the Arrow PyCapsule Interface, implemented by Polars and the ADBC driver manger (specifically on the ArrowArrayStreamHandle returned by stmt.execute_query()
The DBAPI (which is where adbc_ingest also is) currently requires PyArrow. I think I'll ask the ADBC people if this can be relaxed/removed at all. adbc_ingest also implements the Arrow PyCapsule Interface, so it could also be possible to write to BQ without PyArrow (with ADBC)
EDIT: Here is the feature request apache/arrow-adbc#2413
EDIT EDIT: It has been completed apache/arrow-adbc#2609 and released in version 1.6.0
Perhaps the BigQuery client / BigQuery storage client could also implement Arrow PyCapsule Interface 😉, there is a growing list
Could this be possible for methods that already return results in the Arrow memory format? (like google.cloud.bigquery.table.RowIterator.to_arrow)
Activity
henryharbeck commentedon Dec 18, 2024
I'm unsure if you're aware, but it looks like BigQuery does have ADBC drivers implemented in C# and Go. Python wheels were included for the first time in the recent release.
There is still a fair bit to be desired (including a page in the docs), with a to do list outlined here.
Also, according to the writing new drivers page:
I haven't installed or tested anything - just observations. Just figured I would give a heads up on it.
Cheers
tswast commentedon Jan 3, 2025
I was not aware. That's awesome news.
henryharbeck commentedon Jan 5, 2025
Here is the PyPi package - https://pypi.org/project/adbc-driver-bigquery/
After some tinkering with the low-level API I've also figured out how to read data directly into Polars without PyArrow or the BigQuery client libraries.
This is thanks to the Arrow PyCapsule Interface, implemented by Polars and the ADBC driver manger (specifically on the ArrowArrayStreamHandle returned by
stmt.execute_query()The DBAPI (which is where
adbc_ingestalso is) currently requires PyArrow. I think I'll ask the ADBC people if this can be relaxed/removed at all.adbc_ingestalso implements the Arrow PyCapsule Interface, so it could also be possible to write to BQ without PyArrow (with ADBC)EDIT: Here is the feature request apache/arrow-adbc#2413
EDIT EDIT: It has been completed apache/arrow-adbc#2609 and released in version 1.6.0
Perhaps the BigQuery client / BigQuery storage client could also implement Arrow PyCapsule Interface 😉, there is a growing list
Could this be possible for methods that already return results in the Arrow memory format? (like
google.cloud.bigquery.table.RowIterator.to_arrow)tswast commentedon Jan 21, 2025
Closing since apache/arrow-adbc#168 has already completed a
adbc-driver-bigquery. Thanks @henryharbeck for the pointer and code sample!Opening googleapis/google-cloud-python#15699 to track the Arrow PyCapsule item.