James Taylor created PHOENIX-3458:
-------------------------------------

             Summary: Cannot add primary key column to tenant specific view 
derived from global view
                 Key: PHOENIX-3458
                 URL: https://issues.apache.org/jira/browse/PHOENIX-3458
             Project: Phoenix
          Issue Type: Bug
            Reporter: James Taylor


To repro:
- create a multi tenant table
- create a global view from multi tenant table
- create a tenant specific view from global view
- add a new primary key column to global view
- attempt to add same primary key column to tenant specific view and you'll get 
this error
{code}
0: jdbc:phoenix:localhost> alter view ts add k4 varchar primary key;
Error: ERROR 1012 (42M03): Table undefined. tableName=MT (state=42M03,code=1012)
org.apache.phoenix.schema.TableNotFoundException: ERROR 1012 (42M03): Table 
undefined. tableName=MT
        at 
org.apache.phoenix.schema.PMetaDataImpl.getTableRef(PMetaDataImpl.java:71)
        at 
org.apache.phoenix.jdbc.PhoenixConnection.getTable(PhoenixConnection.java:452)
        at 
org.apache.phoenix.schema.MetaDataClient.getParentOfView(MetaDataClient.java:3570)
        at 
org.apache.phoenix.schema.MetaDataClient.addColumn(MetaDataClient.java:2947)
        at 
org.apache.phoenix.schema.MetaDataClient.addColumn(MetaDataClient.java:2738)
        at 
org.apache.phoenix.jdbc.PhoenixStatement$ExecutableAddColumnStatement$1.execute(PhoenixStatement.java:1166)
        at 
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:358)
        at 
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:341)
        at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
        at 
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:339)
        at 
org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1511)
        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}



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

Reply via email to