database – Is there a way for Cassandra to ignore clustering key when inserting?

Right now I have a table with three columns: GroupId,ObjectId and Data, with first two defined as partition key.

Currently it works as desired: if GroupIdand ObjectId match existing row, it gets overwritten.

I’m trying to add sorting by date, so I added third column, LastModified and specified it as clustering key. While it works for sorting, now I have multiple rows sharing the same GroupIdand ObjectId pairs, which is not what I need.

How can I achieve previous behaviour?

  1. I could read table before writing and delete matching row before writing a new one.
  2. I could, after reading, filter rows in my application.

I dislike both solutions because they seem to be too complicated and performance is a big concern. Is there a better way?