You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2016/07/26 00:38:20 UTC
[jira] [Resolved] (PHOENIX-2853) Delete Immutable rows from View
does not work if immutable index(secondary index) exists
[ https://issues.apache.org/jira/browse/PHOENIX-2853?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James Taylor resolved PHOENIX-2853.
-----------------------------------
Resolution: Cannot Reproduce
This works fine in 4.8.0. Note that you cannot declare FIELD4 as NOT NULL in TEST_VIEW because it's not part of the primary key constraint (but that won't have any bearing on this JIRA). Please reopen if you can repro this under different circumstances.
> 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
> Labels: SFDC
> Fix For: 4.8.1
>
>
> 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)