Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-9312

Provide a way to retrieve the write time of a CQL row

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • 5.x
    • Legacy/CQL
    • Semantic
    • Low Hanging Fruit

    Description

      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.

      Attachments

        Activity

          People

            yangyis Yangyi Shi
            nff Nicolas Favre-Felix
            Yangyi Shi
            Votes:
            5 Vote for this issue
            Watchers:
            19 Start watching this issue

            Dates

              Created:
              Updated: