Support Questions
Find answers, ask questions, and share your expertise

phoenix index stale data after delete all rows and upsert new row

New Contributor

I've got a stale data for phoenix local indexes after upsert and delete all rows. Consider script:

create schema if not exists TS
create table if not exists TS.TEST (STR varchar not null,INTCOL bigint not null, STARTTIME integer, DUMMY integer default 0 CONSTRAINT PK PRIMARY KEY (STR, INTCOL))
create local index if not exists "TEST_INDEX" on TS.TEST (STR,STARTTIME)
delete from TS.TEST
upsert into TS.TEST(STR,INTCOL,STARTTIME,DUMMY) values ('TEST',4,1,3)
delete from TS.TEST
upsert into TS.TEST( STR, INTCOL, STARTTIME, DUMMY) values ('TEST',4,2,4)
delete from TS.TEST
upsert into TS.TEST ( STR, INTCOL, DUMMY) values ('TEST',4,5)

SELECT /*+NO_INDEX*/* FROM TS.TEST where STR = 'TEST'
-- yields: STARTTIME = 2
SELECT /*+TEST_INDEX*/ * FROM TS.TEST where STR = 'TEST'
-- yields: STARTTIME = null

Phoenix: 4.13.2 on top of cdh-5.13.0. I wonder if someone can point me on bug or explain why is this happening and this is expected?

2 REPLIES 2

New Contributor

I've also tested on latest phoenix 5.0 on top of hbase 2.0.2 and it seems like not yet fixed.

Yes, it's a bug , please raise a JIRA under https://issues.apache.org/jira/browse/PHOENIX

; ;