Jiping Zhou created PHOENIX-2853:
------------------------------------
Summary: Delete Immutable rows from View does not work if
immutable index(secondary index) exists
Key: PHOENIX-2853
URL: https://issues.apache.org/jira/browse/PHOENIX-2853
Project: Phoenix
Issue Type: Bug
Affects Versions: 4.7.0
Reporter: Jiping Zhou
REPRO:
--create a immutable table
CREATE TABLE IF NOT EXISTS TEST_TABLE (
FIELD1 CHAR(3) NOT NULL,
FIELD2 CHAR(3) NOT NULL,
CONSTRAINT PK PRIMARY KEY (
FIELD1,
FIELD2
)
) VERSIONS=1, IMMUTABLE_ROWS=true, MULTI_TENANT=true, REPLICATION_SCOPE=1
--create a new view on the immutable table
CREATE VIEW IF NOT EXISTS TEST_VIEW (
FIELD3 INTEGER NOT NULL,
FIELD4 VARCHAR NOT NULL,
CONSTRAINT PKVIEW PRIMARY KEY
(
FIELD3 DESC
)
)
AS SELECT * FROM TEST_TABLE WHERE FIELD2 = '001'
-- create secondary index on the
CREATE INDEX IF NOT EXISTS TEST_SECONDARY_INDEX
ON TEST_VIEW (FIELD4 DESC)
INCLUDE (FIELD3)
REPLICATION_SCOPE=1
--Delete rows for TEST_VIEW
delete from TEST_VIEW where FIELD1 = '000';
[Expect] The rows can be removed
[Actual] Under DeleteCompiler.Compile(), the secondary index will be considered
as immutable index. And as line 408, table.getType will be VIEW instead of
PTableType.INDEX, we will get error in line 425 with the exception.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)