Does timestamp by default appear in an HBase table?

NJ_315 picture NJ_315 · Jul 8, 2013 · Viewed 7.7k times · Source

When we create any HBase table, does timestamp appear in that table when we scan it?

For example:

create 'test', 'cf'

put 'test', 'row1', 'cf:a', 'value1'

put 'test', 'row2', 'cf:b', 'value2'

put 'test', 'row3', 'cf:c', 'value3'

scan 'test'

ROW COLUMN+CELL

row1 column=cf:a, timestamp=1288380727188, value=value1

row2 column=cf:b, timestamp=1288380738440, value=value2

row3 column=cf:c, timestamp=1288380747365, value=value3

Answer

Roman Nikitchenko picture Roman Nikitchenko · Jul 9, 2013

Timestamps are actually mandatory part of HBase columns and their main purpose is column versioning. Here is some more detailed explanation about versions and timestamps. Also "HBase definitive guide" book contains detailed PUT operation description which discovers almost everything you can do with timestamps (TS).

The hints here are:

  • If you don't specify TS in PUT, server adds it automatically.
  • You can specify any TS if you specify it manually so you are actually not limited with 'recommended' usage of this field and there is lot of alternatives.
  • Additional options for timestamps (TS) are discovered by 'keep deleted records' table options, minimum number of versions to keep and data 'time to live' (TTL) support.

So yes, you cannot get rid of these timestamps / versions but there is lot of options how to use them.