Friday 7 February 2020

Cassandra: WRITETIME: Get write time of the column

A Cassnadra table contains a timestamp, which specifies the time that a write occurred to a column. You can get this timestamp value Using the WRITETIME function. WRITETIME function returns the time in microseconds.

cqlsh> SELECT * FROM cassandratutorial.employee;

 id | age | firstname | lastname
----+-----+-----------+----------
  1 |  31 |      Hari |   Gurram
  2 |  31 |       Ram |   Gurram
  3 |  33 |       Ram |   Ponnam

(3 rows)
cqlsh> 
cqlsh> SELECT id, WRITETIME(firstname) FROM cassandratutorial.employee;

 id | writetime(firstname)
----+----------------------
  1 |     1555393882415773
  2 |     1555392702737296
  3 |     1555394042089780

(3 rows)


Previous                                                    Next                                                    Home

No comments:

Post a Comment