[ 
https://issues.apache.org/jira/browse/PHOENIX-2783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15211063#comment-15211063
 ] 

Biju Nair commented on PHOENIX-2783:
------------------------------------

If anyone face the scenario detailed in the description of this issue i.e. 
table not being usable due to duplicate columns used while creating an index, 
the following may be way to recover. Please validate the process yourself 
before using it.

Through Phoenix {{sqlline.py}} delete relevant {{SYSTEM.CATALOG}} entries
{noformat}
delete from SYSTEM.CATALOG where table_name = 'IDX';

delete from SYSTEM.CATALOG where COLUMN_FAMILY = 'IDX' and TABLE_NAME = 'X';
{{noformat}}

Through base shell, delete the index created with duplicate columns

{{noformat}}
$ hbase shell

hbase(main):002:0> disable 'IDX'
0 row(s) in 1.6090 seconds

hbase(main):006:0> drop 'IDX'
0 row(s) in 0.3120 seconds
{{noformat}} 

> Creating secondary index with duplicated columns makes the catalog corrupted
> ----------------------------------------------------------------------------
>
>                 Key: PHOENIX-2783
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2783
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.7.0
>            Reporter: Sergey Soldatov
>            Assignee: Sergey Soldatov
>         Attachments: PHOENIX-2783-1.patch, PHOENIX-2783-2.patch
>
>
> Simple example
> {noformat}
> create table x (t1 varchar primary key, t2 varchar, t3 varchar);
> create index idx on x (t2) include (t1,t3,t3);
> {noformat}
> cause an exception that duplicated column was detected, but the client 
> updates the catalog before throwing it and makes it unusable. All following 
> attempt to use table x cause an exception ArrayIndexOutOfBounds. This problem 
> was discussed on the user list recently. 
> The cause of the problem is that check for duplicated columns happen in 
> PTableImpl after MetaDataClient complete the server createTable. 
> The simple way to fix is to add a similar check in MetaDataClient before 
> createTable is called. 
> Possible someone can suggest a more elegant way to fix it? 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to