-
Notifications
You must be signed in to change notification settings - Fork 19
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
Odd rounding #99
Comments
AFAIR big int always should be passed as text to db drivers, unless they support big int. https://stackoverflow.com/questions/19169164/r-rpostgresql-bigint-datatype |
I think I see your point. It feels like we should get that last decimal digit (until we have more digits than floating point can represent), but as floating point is in binary things are not that simple (as each stage may round or alter the format for its own notions of safety). That being said, it still seems we are losing one more digit than we should. |
I'd like to second the suggestion that bigint columns be handled as text rather than numeric. I got bitten today when 9 bits of precision were silently dropped from an index column, creating a number of collisions in what should have been a unique ID. And in the interim, for anyone who needs a workaround you can cast the bigint to text on the database side (e.g. SELECT big_id_column::text FROM table_with_bigint_id) and either keep the character value or convert to the 64-bit integer type supplied by the bit64 package. |
From tidyverse/dplyr#3516 . Notice how violently the value is rounded when round-tripped through the database. The amount of rounding depends on the driver (so may not be a pure
DBI
issue).The text was updated successfully, but these errors were encountered: