cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Eriksson <tobias.eriks...@qvantel.com>
Subject CQL: fails to COPY <table> FROM <filename> with null values
Date Mon, 19 Jun 2017 14:10:15 GMT
Hi
 I am trying to copy a file of CSV data into a table
But I get an error since sometimes one of the columns (which is a UUID) is empty
Is this a bug or what am I missing?

Here is how it looks like
Table
    id uuid,
    lastname text,
    firstname text,
    address_id uuid,
    dateofbirth timestamp,

PRIMARY KEY (id, lastname, firstname)

COPY playground.individual(id,lastname,firstname,address_id) FROM ‘testfile.csv’;

Where the testfile.csv is like this

This works !!!
ce98d62a-3666-4d3a-ae2f-df315ad448aa,Jonsson,Malcom ,c9dc8b60-d27f-430c-b960-782d854df3a5,2001-01-19
17:55:17+0000

This does NOT work !!!
ce98d62a-3666-4d3a-ae2f-df315ad448aa,Jonsson,Malcom , ,2001-01-19 17:55:17+0000

Cause then I get the following error
Failed to import 1 rows: ParseError - badly formed hexadecimal UUID string,  given up without
retries

So, how do I import my CSV file and set the columns which does not have a UUID to null ?

-Tobias
Mime
View raw message