Data import from CSV file into CRDB in a specific row range

I’m using the following format to import my data stored in a CSV file.

| IFS=","; while read a b c; do echo “INSERT INTO csv VALUES ($a, $b, $c);”; done < test.csv;

How can I import lines in a specific range, like rows between 100 and 200?

And what is the limit for the number of rows can be imported at a time?

By “rows between” 100 and 200 you mean rows belonging to lines 100-200 in your input file?
If so, according to

you can use something like

sed -n 100,200p test.csv | (IFS=","; while read a b c; do echo “INSERT INTO csv VALUES ($a, $b, $c);”; done)

I believe v1.1 of CockroachDB will also allow you to ingest CSV files more directly. Perhaps @mjibson can add to that.

1 Like

Yes, in 1.1 we will support high speed loading of CSV files.

1 Like