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

Reply via email to