[
https://issues.apache.org/jira/browse/CASSANDRA-9312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17883049#comment-17883049
]
Benjamin Lerer edited comment on CASSANDRA-9312 at 9/19/24 3:48 PM:
--------------------------------------------------------------------
It would unfortunately not work. In the C* world you can have an UPDATE older
than an INSERT were the mix of both result in some columns having a timestamp
older than the one of the row.
was (Author: blerer):
It would unfortunately not work. In the C* world you can have an UPDATE older
than an INSERT were the mix of both result in some columns having a timestamp
older than the row.
> Provide a way to retrieve the write time of a CQL row
> -----------------------------------------------------
>
> Key: CASSANDRA-9312
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9312
> Project: Cassandra
> Issue Type: New Feature
> Components: Legacy/CQL
> Reporter: Nicolas Favre-Felix
> Assignee: Yangyi Shi
> Priority: Normal
> Labels: lhf
> Fix For: 5.x
>
>
> There is currently no way to retrieve the "writetime" of a CQL row. This is
> an issue for tables in which all dimensions are part of the primary key.
> Since Cassandra already stores a cell for the CQL row, it would make sense to
> provide a way to read its timestamp. This feature would be consistent with
> the concept of a row as an entity containing a number of optional columns,
> but able to exist on its own.
> +Additional information for newcomers+
> As [~slebresne] suggested in the comments, this functionality can be done by
> allowing the {{writeTime}} and {{ttl}} methods on primary key columns. To do
> that you will need to:
> * remove the check of {{Selectable.WritetimeOrTTL}} preventing the use of
> {{writeTime}} and {{ttl}} methods on primary key columns
> * add a new method like {{add(ByteBuffer v, LivenessInfo livenessInfo, int
> nowInSec)}} to {{ResultSetBuilder}} that method should populate the value as
> well as the timestamps and ttls if needed
> * In {{SelectStatement.processPartition}} retrieve the row
> primaryKeyLivenessInfo and call the new {{ResultSetBuilder}} method with
> those information.
> * Adds some unit tests in {{SelectTest}}.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]