I have table which has versions enabled.
CREATE TABLE IF NOT EXISTS customer ( firstName CHAR(15), lastName CHAR(15), address char(100), ssn integer NOT NULL, effective_date DATE NOT NULL CONSTRAINT pk PRIMARY KEY (ssn, effective_date ROW_TIMESTAMP) ) VERSIONS=10000000;
I upserted the record 4 times. How do I query all the versions?
For example I use
select * from customer where EFFECTIVE_DATE < CURRENT_DATE();
I am expecting all the versions for that row. Please advise.
You can check relevant discussion on PHOENIX-590 for your requirements.
Currently, Phoenix doesn't support getting all the versions at the same time, but it allows you to do point-in-time queries to see a version at that time. check below link
We get startKey, stopKey , PK from phoenix(very important) , then exe a hbase scan (scan.setMaxVersions()) to get all versions data