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

Ankit Singhal commented on PHOENIX-3002:
----------------------------------------

Had pinged [~rajeshbabu] internally about the error during upgrade of local 
indexes on multi-tenant tables.
*Re-opening for tracking it for 4.8 release.*

For eq:-

{code}
CREATE TABLE test.MT_BASE (PK1 VARCHAR not null, PK2 VARCHAR not null, 
MYCF1.COL1 varchar,MYCF2.COL2 varchar CONSTRAINT pk PRIMARY KEY(PK1,PK2)) 
MULTI_TENANT=true;
CREATE VIEW acme AS SELECT * FROM test.MT_BASE;
create local index idx on acme(pk2);
CREATE VIEW abc.acme AS SELECT * FROM test.MT_BASE;
create local index idx on abc.acme(pk2);

"With New Tenant": 
CREATE VIEW test_v AS SELECT * FROM test.MT_BASE;
create local index idx on test_v(pk2);

CREATE VIEW def.acme AS SELECT * FROM test.MT_BASE;
create local index idx on def.acme(pk2);
{code}
{code}
"Exception":-
6/06/28 17:00:12 WARN util.NativeCodeLoader: Unable to load native-hadoop 
library for your platform... using builtin-java classes where applicable
org.apache.phoenix.schema.ColumnAlreadyExistsException: ERROR 514 (42892): A 
duplicate column name was detected in the object definition or ALTER TABLE 
statement. columnName=IDX.:PK1
  at 
org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:2044)
  at 
org.apache.phoenix.schema.MetaDataClient.createIndex(MetaDataClient.java:1458)
  at 
org.apache.phoenix.compile.CreateIndexCompiler$1.execute(CreateIndexCompiler.java:85)
  at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:343)
  at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:331)
  at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
  at 
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:329)
  at 
org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1440)
  at 
org.apache.phoenix.util.UpgradeUtil.upgradeLocalIndexes(UpgradeUtil.java:441)
  at 
org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2484)
  at 
org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2300)
  at 
org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:78)
  at 
org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:2300)
  at 
org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:231)
  at 
org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:135)
  at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:202)
  at java.sql.DriverManager.getConnection(DriverManager.java:571)
  at java.sql.DriverManager.getConnection(DriverManager.java:187)
  at org.apache.phoenix.util.PhoenixRuntime.main(PhoenixRuntime.java:217)
{code}

> Upgrading to 4.8 doesn't recreate local indexes
> -----------------------------------------------
>
>                 Key: PHOENIX-3002
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3002
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Samarth Jain
>            Assignee: Rajeshbabu Chintaguntla
>            Priority: Blocker
>             Fix For: 4.8.0
>
>         Attachments: PHOENIX-3002.patch, PHOENIX-3002_addendum.patch, 
> PHOENIX-3002_v0.patch, PHOENIX-3002_v1.patch, PHOENIX-3002_v2.patch, 
> PHOENIX-3002_v3.patch
>
>
> [~rajeshbabu] - I noticed that when upgrading to 4.8, local indexes created 
> with 4.7 or before aren't getting recreated with the new local indexes 
> implementation.  I am not seeing the metadata rows for the recreated indices 
> in SYSTEM.CATALOG.



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

Reply via email to