cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.03k stars 3.8k forks source link

bulk-io: ERROR message on failed import from csv job does not show the raw row #76514

Open fabiog1901 opened 2 years ago

fabiog1901 commented 2 years ago

Describe the problem

The ERROR message on a failed import job from csv doesn't accurately show the right number of columns.

To Reproduce

file f.csv

1,"hello,world"
root@:26257/defaultdb> create table t (id int primary key, name string, age int);
root@:26257/defaultdb> import into t csv data ('http://localhost:3000/f.csv');
ERROR: http://localhost:3000/f.csv: error parsing row 1: expected 3 fields, got 2 (row: "1,hello,world")

From the error message, it looks like the row has 3 fields, not 2.

So I think it would be better to paste the row in raw format: 1,"hello,world"

Environment:

root@:26257/defaultdb> select version();
                                        version
----------------------------------------------------------------------------------------
  CockroachDB CCL v21.2.4 (x86_64-apple-darwin19, built 2022/01/10 18:53:16, go1.16.6)
(1 row)

Jira issue: CRDB-13161

blathers-crl[bot] commented 2 years ago

cc @cockroachdb/bulk-io