dolt icon indicating copy to clipboard operation
dolt copied to clipboard

dolt schema import does not support long columns

Open timsehn opened this issue 3 years ago • 1 comments

The max it will create is a varchar(16383) so if you try to import a CSV with longer columns it will fail.

is not valid for column "client" (type "VARCHAR(16383)")

Here is the repro.

File: ab_test.csv

dolt init
dolt table import ab_test ab_test.csv -c --pk=abtest_id

Here is the dolt schema import output:

test-csv-json-issue $ dolt schema import --dry-run ab_test ab_test.csv -c --pks abtest_id
CREATE TABLE `ab_test` (
  `abtest_id` int unsigned NOT NULL,
  `client` varchar(16383) NOT NULL,
  `condition_col` varchar(16383) NOT NULL,
  `condition_bin` varchar(16383) NOT NULL,
  `is_enabled` bit(1) NOT NULL,
  `comment` varchar(16383) NOT NULL,
  PRIMARY KEY (`abtest_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

timsehn avatar Nov 16 '21 20:11 timsehn

Dolt should create TEXT columns instead.

timsehn avatar Aug 30 '22 20:08 timsehn