Hello,
Im trying to understand what excatly Phoenix row timestamp is
I created 2 tables for test:

CREATE TABLE test_row_timestamp1(
    id varchar NOT NULL,
    created TIMESTAMP NOT NULL,
    foo varchar,
    CONSTRAINT PK PRIMARY KEY( id, created ROW_TIMESTAMP )
)

CREATE TABLE test_row_timestamp2(
    id varchar NOT NULL,
    created TIMESTAMP NOT NULL,
    foo varchar,
    CONSTRAINT PK PRIMARY KEY( id, created )
)

upsert into test_row_timestamp1 (id, created, foo) values ('1', now(), 'bar');
upsert into test_row_timestamp2 (id, created, foo) values ('1', now(), 'bar');

And result is:

hbase(main):004:0> scan 'TEST_ROW_TIMESTAMP1', { LIMIT=>10}
ROW                                                              COLUMN+CELL
 1\x00\x80\x00\x01Z\xB4\x80:6\x00\x00\x00\x00                    column=0:FOO, 
timestamp=1489086986806, value=bar
 1\x00\x80\x00\x01Z\xB4\x80:6\x00\x00\x00\x00                    column=0:_0, 
timestamp=1489086986806, value=x

hbase(main):005:0> scan 'TEST_ROW_TIMESTAMP2', { LIMIT=>10}
ROW                                                              COLUMN+CELL
 1\x00\x80\x00\x01Z\xB4\x80M\xE6\x00\x00\x00\x00                 column=0:FOO, 
timestamp=1489086991848, value=bar
 1\x00\x80\x00\x01Z\xB4\x80M\xE6\x00\x00\x00\x00                 column=0:_0, 
timestamp=1489086991848, value=x

Both tables has the same row key pattern id + 0x00 + timestamp
I expect that test_row_timestamp1 will utilise native hbase timestamp that is 
part of "real" hbase key.


PS. Examples at https://phoenix.apache.org/rowtimestamp.html 
<https://phoenix.apache.org/rowtimestamp.html> are broken

Reply via email to