pymapd
pymapd copied to clipboard
load_table (rowwise) can be incorrect in presence of scientific notation
trafficstars
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')
Possible solution would be to explicitly format strings to some level of precision:
https://stackoverflow.com/a/33219633/2394542