question

BhatVivekNonEmp-2991 avatar image
0 Votes"
BhatVivekNonEmp-2991 asked ·

Does azure cosmos db cassandra api support compound primary key?

Referring to https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useCompoundPrimaryKeyConcept.html.

I have a schema in which I have multiple primary keys which is something similar to this:

CREATE TABLE cyclist_category ( 
category text, 
points int, 
id UUID, 
lastname text,     
PRIMARY KEY (category, points)
) WITH CLUSTERING ORDER BY (points DESC);


Can I create a similar schema in azure cosmos db with cassandra api?

azure-cosmos-db
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MarkBrownMSFT avatar image
0 Votes"
MarkBrownMSFT answered ·

In Cosmos DB the primary key maps to the partition key where we don't yet support compound partition keys. You would have to concatenate the values here as a work around.

Thanks.

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@BhatVivekNonEmp-2991 Just checking in to see if the above answer helped.

If this answers your query, please “Accept Answer” and Up-Vote for the same which might be beneficial to other community members reading this thread .
And, if you have any further queries do let us know. 

0 Votes 0 ·