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

load_table (rowwise) can be incorrect in presence of scientific notation #208

Open
randyzwitch opened this issue Apr 10, 2019 · 1 comment
Labels

Comments

@randyzwitch
Copy link
Contributor

In working on #203, noticed that for bigint, if you have large enough numbers and have nulls, pandas will convert the column to float64 AND convert it to scientific notation. Loading the table rowwise into a pre-existing BIGINT column will convert the scientific notation float into a string, and OmniSci backend will truncate at the decimal point. So a gigantic number will be loaded as if it were 0-9, instead of a large number.

pseudocode:

data = np.random.randint(low=-9223372036854775807,
                                 high=9223372036854775807, size=n_samples,
                                 dtype='int64')

df = pd.DataFrame(data)

con.load_table("preexisting_int_table", df, method='rows') 
@randyzwitch
Copy link
Contributor Author

Possible solution would be to explicitly format strings to some level of precision:

https://stackoverflow.com/a/33219633/2394542

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant