heavyai / heavydb

HeavyDB (formerly OmniSciDB)
https://heavy.ai
Apache License 2.0
2.96k stars 448 forks source link

copy command fails on a sharded table when using decimals with fixed encoding #344

Open cdessanti opened 5 years ago

cdessanti commented 5 years ago

Hi, create statement


CREATE TABLE test_dec (
id_key INTEGER,
amount DECIMAL(4,2) ENCODING FIXED(16),
SHARD KEY (id_key))
WITH (SHARD_COUNT = 3)

data is testdec.csv

1,90.20
2,89.45
3,50.10
1,15.40
2,9.0

Copy statement and result

omnisql> copy test_dec from '/home/mapd/test_dec.csv' with (header='false');
Result
Loader truncated due to reject count.  Processed : 5 recs, Rejected: 0 recs in 0.041000 secs
1 rows returned.
Execution time: 41 ms, Total time: 41 ms

the error message into the logs

E0402 19:46:09.331586 23817 Importer.cpp:2608] Fragmenter Insert Exception: Decimal overflow: value is greater than 10^2
E0402 19:46:09.331746 23814 Importer.cpp:3557] A call to the Loader::load failed, Please review the logs for more details
E0402 19:46:09.344377 23804 ParserNode.cpp:3410] COPY exited early due to reject records count during multi file processing

on a no-sharded table, the copy is successful

cdessanti commented 5 years ago

update:

The load of the table fails also using the legacy \copy command and the StreamInserter utility. While those tools don't raise any error, when load is finished the table is empty