crate / crate-clients-tools

Clients, tools, and integrations for CrateDB.
https://crate.io/docs/clients/
Apache License 2.0
2 stars 1 forks source link

DBeaver: `NumberFormatException` when importing data into table with boolean column #112

Open hlcianfagna opened 2 months ago

hlcianfagna commented 2 months ago
create table repro (flag BOOLEAN);

Then create a .csv file and try to import it from DBeaver with the default "Data load settings" with "Skip bind values during insert" not selected

flag
0

In CrateDB this will fail with

NumberFormatException in java.base/java.math.BigDecimal.<init>(BigDecimal.java:703).CXX000.FSQLExceptions.java.ResToCrateException.L152.Wio.crate.exceptions.SQLExceptions.esToCrateException(SQLExceptions.java:152)

in PostgreSQL it works (DBeaver also succeeds if the column is INT instead of BOOLEAN or if we select the option to skip binding)

I can get the same stack trace in Java if I use a setBigDecimal against a PreparedStatement instead of a setBoolean , however this fails also against pgqsl while DBeaver works against pgsql.

So perhaps this something about pg_type not having composite type entries for the tables or about pg_description not having an entry for the boolean data type?

amotl commented 1 month ago

Hi @hlcianfagna. Thanks for your report.

Can I humbly ask you to evaluate the problem closer, maybe together with @surister, @seut, or @proddata, and maybe derive or transfer this issue into crate/crate, also tagging it with tool: DBeaver, when applicable?