dolt icon indicating copy to clipboard operation
dolt copied to clipboard

Allow importing CSVs without column names.

Open nicktobey opened this issue 1 year ago • 2 comments

Both MySQL and SQLite have an option when importing data to skip the first N rows of the source file:

MySQL: LOAD DATA INFILE ... IGNORE 1 ROWS SQLite: .import --skip 1 ...

This is often used to skip the first row in a csv if it contains column names instead of data, but the skip value can also be deliberately omitted in order to treat the first row as data.

Dolt behaves differently: it always assumes that the first row contains column names, and there doesn't appear to be a way to force Dolt to treat the first row of a csv as data. This makes it impossible for Dolt to import csvs if they don't contain column names.

There should be a way to import these csvs into Dolt, whether it's via a --no-column-names flag, or by adding the --skip flag that matches SQLite (and implies no column names)

nicktobey avatar May 07 '24 19:05 nicktobey

Can i take this one?

vhespanha avatar Jun 25 '24 00:06 vhespanha

Yes. Definitely

timsehn avatar Jun 25 '24 00:06 timsehn