PLANNED MAINTENANCE

Hello, DataStax Community!

We want to make you aware of a few operational updates which will be carried out on the site. We are working hard to streamline the login process to integrate with other DataStax resources. As such, you will soon be prompted to update your password. Please note that your username will remain the same.

As we work to improve your user experience, please be aware that login to the DataStax Community will be unavailable for a few hours on:

  • Wednesday, July 15 16:00 PDT | 19:00 EDT | 20:00 BRT
  • Thursday, July 16 00:00 BST | 01:00 CEST | 04:30 IST | 07:00 CST | 09:00 AEST

For more info, check out the FAQ page. Thank you for being a valued member of our community.


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 · ·