phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ihor Krysenko (JIRA)" <j...@apache.org>
Subject [jira] [Created] (PHOENIX-4802) Empty index table after REBUILD.
Date Tue, 03 Jul 2018 08:30:00 GMT
Ihor Krysenko created PHOENIX-4802:
--------------------------------------

             Summary: Empty index table after REBUILD.
                 Key: PHOENIX-4802
                 URL: https://issues.apache.org/jira/browse/PHOENIX-4802
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.14.0
         Environment: Cloudera 5.11.2, Phoenix version 4.14.0-cdh5.11.2
            Reporter: Ihor Krysenko


After local index rebuild, idx table will be empty, search in main table by indexed field
returns nothing.

There is interesting moment if use:

ALTER INDEX \{idx name} ON \{table name} REBUILD;

Than index never will be rebuild correct.

But if use next:

ALTER INDEX \{idx name} on \{table name} REBUILD SOME_FAKE_PROPERTY=1;

First call won't rebuild index correctly, but next call will rebuild index and search criterial
will works.

 

Scripts to reproduce env:

CREATE SCHEMA IF NOT EXISTS TST_NS;
CREATE TABLE IF NOT EXISTS TST_NS.TEST (
 FIELD_1 CHAR(7) NOT NULL,
 FIELD_2 VARCHAR(8) NOT NULL,
 FIELD_3 TIME NOT NULL,
 FIELD_4 UNSIGNED_INT NOT NULL,
 CF.FIELD_5 BIGINT,
 CF.FIELD_6 INTEGER
 CONSTRAINT CFPK PRIMARY KEY (FIELD_1, FIELD_2, FIELD_3, FIELD_4)
) COMPRESSION='SNAPPY', IMMUTABLE_ROWS=true;
CREATE LOCAL INDEX IF NOT EXISTS IDX_TEST ON TST_NS.TEST (FIELD_1 ASC, FIELD_3 ASC, FIELD_2
ASC) COMPRESSION='SNAPPY';

UPSERT INTO TST_NS.TEST VALUES ('record1', 'testrow1', TO_TIME('2018-07-03 10:00:01.123'),
134100, 111123131, 12133);
UPSERT INTO TST_NS.TEST VALUES ('record2', 'testrow2', TO_TIME('2018-07-03 10:00:01.124'),
134101, 111123132, 12134);
UPSERT INTO TST_NS.TEST VALUES ('record3', 'testrow3', TO_TIME('2018-07-03 10:00:01.125'),
134102, 111123133, 12135);
UPSERT INTO TST_NS.TEST VALUES ('record8', 'testrow4', TO_TIME('2018-07-03 10:00:01.126'),
134103, 111123134, 12136);
UPSERT INTO TST_NS.TEST VALUES ('record8', 'testrow5', TO_TIME('2018-07-03 10:00:01.126'),
134104, 111123135, 12137);
UPSERT INTO TST_NS.TEST VALUES ('record6', 'testrow6', TO_TIME('2018-07-03 10:00:02.123'),
134105, 111123136, 12133);
UPSERT INTO TST_NS.TEST VALUES ('record7', 'testrow6', TO_TIME('2018-07-03 10:00:02.124'),
134106, 111123137, 12133);
UPSERT INTO TST_NS.TEST VALUES ('record8', 'testrow6', TO_TIME('2018-07-03 10:00:03.127'),
134107, 111123138, 12133);



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message