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

William Shen commented on PHOENIX-4551:
---------------------------------------

[~rajeshbabu],

We are running into a similar issue (but not related to auto commit, it happens 
with and without autocommit). Here is a reproducible case in 4.13:
{code:java}
CREATE TABLE IF NOT EXISTS test.t (a INTEGER PRIMARY KEY,b UNSIGNED_INT,c 
BIGINT);
CREATE INDEX IF NOT EXISTS "i1" ON test.t (c) INCLUDE (b);
CREATE INDEX IF NOT EXISTS "i2" ON test.t (c) INCLUDE (a);
delete from test.t where b > 25;{code}
produces
{code:java}
Error: ERROR 514 (42892): A duplicate column name was detected in the object 
definition or ALTER TABLE/VIEW statement. columnName=TEST.TEST.T.C 
(state=42892,code=514)

org.apache.phoenix.schema.ColumnAlreadyExistsException: ERROR 514 (42892): A 
duplicate column name was detected in the object definition or ALTER TABLE/VIEW 
statement. columnName=TEST.TEST.T.C

at org.apache.phoenix.schema.PTableImpl.init(PTableImpl.java:529)

at org.apache.phoenix.schema.PTableImpl.<init>(PTableImpl.java:421)

at org.apache.phoenix.schema.PTableImpl.makePTable(PTableImpl.java:305)

at org.apache.phoenix.compile.DeleteCompiler.compile(DeleteCompiler.java:730)

at 
org.apache.phoenix.jdbc.PhoenixStatement$ExecutableDeleteStatement.compilePlan(PhoenixStatement.java:771)

at 
org.apache.phoenix.jdbc.PhoenixStatement$ExecutableDeleteStatement.compilePlan(PhoenixStatement.java:759)

at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:387)

at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:377)

at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)

at 
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:376)

at 
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:364)

at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1738)

at sqlline.Commands.execute(Commands.java:822)

at sqlline.Commands.sql(Commands.java:732)

at sqlline.SqlLine.dispatch(SqlLine.java:813)

at sqlline.SqlLine.begin(SqlLine.java:686)

at sqlline.SqlLine.start(SqlLine.java:398)

at sqlline.SqlLine.main(SqlLine.java:291){code}
 

And by having just one instead of the indices, the issue goes away:
{code:java}
0: jdbc:phoenix:labs-boba-namenode-lv-101,lab> drop index "i2" on test.t;
No rows affected (5.579 seconds)
0: jdbc:phoenix:labs-boba-namenode-lv-101,lab> delete from test.t where b > 25;
No rows affected (0.011 seconds){code}
 

Do you think this is the same issue resolved in 4.14, or should I file a 
separate bug against 4.13?

> Possible ColumnAlreadyExistsException is thrown from delete when autocommit 
> off
> -------------------------------------------------------------------------------
>
>                 Key: PHOENIX-4551
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4551
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Romil Choksi
>            Assignee: Rajeshbabu Chintaguntla
>            Priority: Major
>             Fix For: 5.0.0-alpha, 4.14.0
>
>         Attachments: PHOENIX-4551.patch, PHOENIX-4551_v2.patch, 
> PHOENIX-4551_v3.patch
>
>
> Here are the simple steps to reproduce it.
> {noformat}
> 0: jdbc:phoenix:localhost> CREATE TABLE IF NOT EXISTS A (a INTEGER PRIMARY 
> KEY,b UNSIGNED_INT,c BIGINT);
> No rows affected (2.3 seconds)
> 0: jdbc:phoenix:localhost> CREATE INDEX idx_global ON A (c);
> No rows affected (7.282 seconds)
> 0: jdbc:phoenix:localhost> CREATE LOCAL INDEX idx_local ON A (c);
> No rows affected (11.322 seconds)
> 0: jdbc:phoenix:localhost> !autocommit off
> *Autocommit status: false*
> 0: jdbc:phoenix:localhost> delete from A where a > 5;
> *Error: ERROR 514 (42892): A duplicate column name was detected in the object 
> definition or ALTER TABLE/VIEW statement. columnName=A.C 
> (state=42892,code=514)*
> org.apache.phoenix.schema.ColumnAlreadyExistsException: ERROR 514 (42892): A 
> duplicate column name was detected in the object definition or ALTER 
> TABLE/VIEW statement. columnName=A.C
>  at org.apache.phoenix.schema.PTableImpl.init(PTableImpl.java:529)
>  at org.apache.phoenix.schema.PTableImpl.<init>(PTableImpl.java:421)
>  at org.apache.phoenix.schema.PTableImpl.makePTable(PTableImpl.java:305)
>  at org.apache.phoenix.compile.DeleteCompiler.compile(DeleteCompiler.java:730)
>  at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableDeleteStatement.compilePlan(PhoenixStatement.java:771)
>  at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableDeleteStatement.compilePlan(PhoenixStatement.java:759)
>  at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:387)
>  at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:377)
>  at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
>  at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:376)
>  at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:364)
>  at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1738)
>  at sqlline.Commands.execute(Commands.java:822)
>  at sqlline.Commands.sql(Commands.java:732)
>  at sqlline.SqlLine.dispatch(SqlLine.java:813)
>  at sqlline.SqlLine.begin(SqlLine.java:686)
>  at sqlline.SqlLine.start(SqlLine.java:398)
>  at sqlline.SqlLine.main(SqlLine.java:291)
> 0: jdbc:phoenix:localhost> 
> {noformat}



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

Reply via email to