I have a table in csv file with roughly 10 million records. The primary key in existing db is an integer field.
Old schema (in existing db):
create table T (id int primary key not null default autoincrement, …);
New schema (in cockroach):
create table T (id uuid primary key not null default gen_random_uuid(), oldid serial not null, …);
Then I import using:
IMPORT INTO T (oldid, …) CSV DATA (‘filename’);
I am expecting import to generate the random uuids for the id field.
It generates id but after some time, I get a collision:
ERROR: duplicate key in primary index: duplicate key: /Table/118/1/"\x00\x00j\x8eu\xb8A\xf2\x80\x005G:\xdc\x10\xf9"/0
Has anyone seen something similar? Am I doing something wrong?