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.
@tswast Need help! What is the precision for BIGNUMERIC when pyarrow converison come into the picture , like for NUMERIC
we have pyarrow.decimal128(38, 9) or any other way to differentiate NUMERIC and BIGNUMERIC
The BIGNUMERIC data type is an exact numeric value with more than 76 digits of precision and exactly 38 decimal digits of scale. Precision is the number of digits that the number contains. Scale is how many of these digits appear after the decimal point
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.
I think pyarrow.decimal256 is not released yet ,checked with the latest release 2.0.0. Done with the development, for the tests i will wait for the feature to be released.
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.
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
@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 pyarrow>=3.0 to be optional (only required when actually using BIGNUMERIC). This is because pyarrow is a core library across many projects in the data science community, so forced upgrades will almost certainly cause customer issues because of version conflicts.
We should continue to run tests against pyarrow==1.0 in our Python 3.6 tests. Any tests that use BIGNUMERIC should be separated from the other pandas & DB-API tests. They should be skipped using pytest's skip mechanism, parsing the version string from pyarrow.__version__ and comparing to >= the parsed version of "3.0.0".
@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?
Activity
HemangChothani commentedon Nov 9, 2020
@tswast Need help! What is the precision for
BIGNUMERICwhen pyarrow converison come into the picture , like forNUMERICwe have
pyarrow.decimal128(38, 9)or any other way to differentiateNUMERICandBIGNUMERICtswast commentedon Nov 9, 2020
From our internal docs:
tswast commentedon Nov 9, 2020
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.
tswast commentedon Nov 12, 2020
We'll need to use
pyarrow.decimal256for this type.HemangChothani commentedon Nov 13, 2020
I think
pyarrow.decimal256is not released yet ,checked with the latest release2.0.0. Done with the development, for the tests i will wait for the feature to be released.tswast commentedon Nov 16, 2020
@emkornfield Do you know when
decimal256will be available inpyarrow? It'll be necessary for pandas integration with BIGNUMERIC.emkornfield commentedon Nov 16, 2020
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.
feat: convert `BIGNUMERIC` values to decimal objects
feat: convert `BIGNUMERIC` values to decimal objects
feat: convert `BIGNUMERIC` values to decimal objects (#414)
tswast commentedon Dec 21, 2020
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
emkornfield commentedon Dec 21, 2020
you could potentially test against pyarrow nightly builds if you want to verify how this works.
tswast commentedon Dec 21, 2020
Yeah, testing with nightly #95 is on my list to try out over the holidays.
HemangChothani commentedon Dec 22, 2020
I have tested
BIGNUMERICbefore with master branch and think it works fine.tswast commentedon Jan 28, 2021
@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
pyarrow>=3.0to be optional (only required when actually using BIGNUMERIC). This is because pyarrow is a core library across many projects in the data science community, so forced upgrades will almost certainly cause customer issues because of version conflicts.We should continue to run tests against
pyarrow==1.0in our Python 3.6 tests. Any tests that use BIGNUMERIC should be separated from the other pandas & DB-API tests. They should be skipped using pytest's skip mechanism, parsing the version string frompyarrow.__version__and comparing to>=the parsed version of"3.0.0".plamut commentedon Jan 28, 2021
@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?
tswast commentedon Jan 28, 2021
Yes. We can wait a few more weeks. Just wanted to check in since this is now unblocked.
shollyman commentedon Feb 12, 2021
Looking at this, it appears we may need some proto publishing/wrangling for the standardsql type mapping as well.
plamut commentedon Feb 16, 2021
@shollyman Good to know, thanks.