As far as I know there is no such thing. You could make that value a single
PK for the table therefore guaranteeing uniqueness and check on insert with
`IF NOT EXISTS` to prevent dups. Of course that works just for one value,
if you have multiple values a compound PK will still let dups in for a
given column. So a different data model might be the answer there. If the
values in those columns can be enumerated then you could always create a
bitmask for the collection of values of the must-be-unique columns and use
that as park of your PK. If they ranges are too broad then maybe some sort
of hash made up of the values that need to be unique would be my next
attempt.

You could also simply enforce the uniqueness programmatically but that will
require a read-before-you-write approach. Three is also the possibility of
using a Cassandra trigger (but I heard they are dangerous and might not buy
you anything more than the client-side programmatic approach)

Cheers,
Brian
http://integrallis.com

On Fri, Feb 27, 2015 at 9:29 PM, ROBIN SRIVASTAVA <
srivastava.robi...@gmail.com> wrote:

> I want to make unique constraint in Cassandra . As i want that all the
> value in my column be unique in my column family
>
>  example : name-rahul ,phone-123, address-abc
>
> now i want that in this row no values equal to rahul ,123 and abc get
> inserted again on searching on datastax i found that i can achieve it by
> doing query on partition key as IF NOT EXIST ,but not getting the solution
> for getting all the three values unique means if
>
> name- jacob ,phone-123 ,address-qwe
>
> this should also be not inserted into my database as my phone column has
> the same value as i have shown with name-rahul.
>



-- 
Cheers,
Brian
http://www.integrallis.com

Reply via email to