-
Notifications
You must be signed in to change notification settings - Fork 306
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
BIGNUMERIC support #367
Comments
@tswast Need help! What is the precision for |
From our internal docs:
|
I don't think 128 bits will be enough for BIGNUMERIC. We should create a table and try to read it with the BigQuery Storage API to see what pyarrow schema it returns. |
We'll need to use |
I think |
@emkornfield Do you know when |
It will be in the next release (3.0.0, January-ish). Should be in nightly builds now but there are some remaining issues to get Python support working. |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-bigquery/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Towards #367 🦕
Since we're using the BQ Storage API (and thus Arrow) for the DB-API connector, we aren't able to support BIGNUMERIC fully in the DB-API until the Arrow release that adds 256-bit decimal support
|
you could potentially test against pyarrow nightly builds if you want to verify how this works. |
Yeah, testing with nightly #95 is on my list to try out over the holidays. |
I have tested from google.cloud import bigquery
from google.cloud.bigquery import dbapi
client = bigquery.Client()
cursor = dbapi.connect(client).cursor()
sql = 'SELECT BIGNUMERIC "3.141592653589793238462643383279502884"'
cursor.execute(sql)
cursor.fetchone() #print Row((Decimal('3.14159265358979323846264338327950288400'),), {'f0_': 0}) |
@plamut Would you have the bandwidth to take this issue? #447 can be a good starting point, but as discussed in #488 (comment) I'd very much like We should continue to run tests against |
@tswast Depends on how urgent it is (I have some PubSub work on my hands ATM), but I can probably at least have a look in a week's time or so - would that be fine? |
Yes. We can wait a few more weeks. Just wanted to check in since this is now unblocked. |
Looking at this, it appears we may need some proto publishing/wrangling for the standardsql type mapping as well. |
@shollyman Good to know, thanks. |
BIGNUMERIC is a new type with even larger decimal precision than NUMERIC. We should ensure we can go to/from
decimal.decimal
and this new data type.The text was updated successfully, but these errors were encountered: