I agree. But this method is probably calculating the deletion time to determine the removal strategy for this complex column. However, when someone tries to read this complex column and there are multiple copies of it in more than one sstables, how the read request will determine which complex data is the latest and should be returned to the user?
Preetika -----Original Message----- From: Minh Do [mailto:m...@netflix.com.INVALID] Sent: Tuesday, January 23, 2018 5:24 PM To: dev@cassandra.apache.org Subject: Re: simple vs complex cells Based on C* 3.x code base, I believe a complex column consists of many cells and each cell has its own timestamp. Then, there is a method to compute the maxTimestamp for a complex column: public long maxTimestamp() { long timestamp = complexDeletion.markedForDeleteAt(); for (Cell cell : this) timestamp = Math.max(timestamp, cell.timestamp()); return timestamp; } On Tue, Jan 23, 2018 at 4:22 PM, Tyagi, Preetika <preetika.ty...@intel.com> wrote: > Hi all, > > I'm trying to understand the behavior of simple and complex columns in > Cassandra. > I was looking at UnfilteredSerializer.java, serializeRowBody() checks > for a timestamp flag and then only it writes it. In case of > writeComplexColumn(), there is no timestamp being written. Also, as > per my understanding, a complex column contains several simple columns > each of which may or may not have a timestamp associated. > > My question is if there is no mandatory timestamp for either simple or > complex columns, how the data will be merged at the time of read > request based on the timestamp given that there can be more than one > copy of the same data in sstables? > > Also, is it allowed in cql queries to update one or more simple > columns within a complex columns? Or the entire complex is updated > whenever there is a update query? > > Thanks, > Preetika > >