incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Petter von Dolwitz (Hem)" <petter.von.dolw...@gmail.com>
Subject Re: Bad Request: Invalid null value for clustering key part
Date Tue, 24 Sep 2013 07:41:40 GMT
Hi Sylvain,

I was not describing the problem correctly. I'm sorry for this. This is the
situation:

1. I'm populating the DB with the java-driver (INSERT INTO...). Some fields
that are part of the primary key is *empty strings*. This works fine.
2. I'm trying to populate the DB from a CSV (COPY ... FROM) using cqlsh.
Some fields that are part of the primary key is *empty strings*. This
scenario gives me the "Bad Request: Invalid null value for clustering key
part {field_name}" message. Seems like empty strings are treated as NULL
when using the COPY .. FROM command?

This can obviously be me not knowing how to encode an empty string in a CSV
file. A simplified row from the CSV file can look like below:

"field1_value","","","field4_value","field5_value"

whereas field1 through field4 is part of the primary key.

Thanks for your time,
Petter




2013/9/23 Sylvain Lebresne <sylvain@datastax.com>

>
> Is it not permitted to have null values in a field that is part a primary
>> key?
>>
>
> It's not.
>
>
>> This seems to be ok when using the java-driver
>>
>
> Are you sure? Because that would qualify as a bug (in the sense that it's
> not supported by C* so there is not reason why this would work with any
> driver). If you have some java driver code that show it possible, I'd be
> happy to have a look.
>
> --
> Sylvain
>

Mime
View raw message