DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

nag9sri_139755 avatar image
nag9sri_139755 asked ·

Why does a partition only have a single row when there are no clustering columns in the primary key?

I am going through the documentation of cassandra , esp Cassandra definitive guide. I come across the following statement

Note that in the case where no clustering columns are provided, each partition consists of a single row

Isn't it each partition will contain "Group of rows" irrespective of clustering column provided( ordering) or not clustering column provided ( no ordering) - but still partition is "Group of rows" . Please add your thoughts

cassandra
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Russell Spitzer avatar image
Russell Spitzer answered ·

When there are no clustering keys a partition can only hold a single row. This is because there is only one row for every unique primary key. A primary key is the partition key and clustering keys combined.


So if there is only a partition key there is only one row per partition. Any additional inserts with the same partition key will overwrite the previous value.

1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Got it. That makes sense as the primary key constitutes only partition key :-) . If the partition key is used along with clustering keys, this partition points to group of rows which further segregated based on clustering key

0 Likes 0 · ·