You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Xinyi Yan (Jira)" <ji...@apache.org> on 2020/07/16 00:45:00 UTC

[jira] [Assigned] (PHOENIX-5976) Cannot drop a column when the index view is involved

     [ https://issues.apache.org/jira/browse/PHOENIX-5976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xinyi Yan reassigned PHOENIX-5976:
----------------------------------

    Assignee: Xinyi Yan

> Cannot drop a column when the index view is involved 
> -----------------------------------------------------
>
>                 Key: PHOENIX-5976
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5976
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.15.0, 4.16.0
>            Reporter: Xinyi Yan
>            Assignee: Xinyi Yan
>            Priority: Blocker
>             Fix For: 4.16.0
>
>
> This is how to reproduce it on the 4.x branch:
> {code:java}
> // create table
> stmt.execute("CREATE TABLE IF NOT EXISTS DUMMY (ID CHAR(10) NOT NULL,KEY_PREFIX CHAR(3) NOT NULL," +
>         " CONSTRAINT PK PRIMARY KEY (ID,KEY_PREFIX))");
> // create view
> stmt.execute(
>         "CREATE VIEW IF NOT EXISTS DUMMY_VIEW  (PK1 DATE NOT NULL,PK2 CHAR(15) NOT NULL," +
>                 "NON_PK1 CHAR(15),NON_PK2 CHAR(15) CONSTRAINT PKVIEW PRIMARY KEY (PK1,PK2)) " +
>                 "AS SELECT * FROM DUMMY WHERE KEY_PREFIX = '123'");
> // create index
> stmt.execute("CREATE INDEX DUMMY_INDEX ON DUMMY_VIEW (PK2, PK1) INCLUDE (NON_PK1, NON_PK2)");
> // drop column
> stmt.execute("ALTER VIEW DUMMY_VIEW DROP COLUMN IF EXISTS NON_PK1");
> {code}
> {code:java}
> org.apache.hadoop.hbase.DoNotRetryIOException: ERROR 504 (42703): ERROR 504 (42703): Undefined column. columnName=0:NON_PK2 DUMMY_VIEWorg.apache.hadoop.hbase.DoNotRetryIOException: ERROR 504 (42703): ERROR 504 (42703): Undefined column. columnName=0:NON_PK2 DUMMY_VIEW at org.apache.phoenix.util.ServerUtil.createIOException(ServerUtil.java:114) at org.apache.phoenix.util.ServerUtil.throwIOException(ServerUtil.java:88) at org.apache.phoenix.coprocessor.MetaDataEndpointImpl.mutateColumn(MetaDataEndpointImpl.java:2823) at org.apache.phoenix.coprocessor.MetaDataEndpointImpl.dropColumn(MetaDataEndpointImpl.java:3026) at org.apache.phoenix.coprocessor.generated.MetaDataProtos$MetaDataService.callMethod(MetaDataProtos.java:17253) at org.apache.hadoop.hbase.regionserver.HRegion.execService(HRegion.java:8523) at org.apache.hadoop.hbase.regionserver.RSRpcServices.execServiceOnRegion(RSRpcServices.java:2282) at org.apache.hadoop.hbase.regionserver.RSRpcServices.execService(RSRpcServices.java:2264) at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:36808) at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2399) at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:124) at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:311) at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:291)Caused by: org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): Undefined column. columnName=0:NON_PK2 at org.apache.phoenix.schema.PColumnFamilyImpl.getPColumnForColumnNameBytes(PColumnFamilyImpl.java:86) at org.apache.phoenix.util.MetaDataUtil.getColumn(MetaDataUtil.java:982) at org.apache.phoenix.coprocessor.DropColumnMutator.validateAndAddMetadata(DropColumnMutator.java:184) at org.apache.phoenix.coprocessor.MetaDataEndpointImpl.mutateColumn(MetaDataEndpointImpl.java:2719) ... 10 more
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)