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

James Taylor commented on PHOENIX-1504:
---------------------------------------

Quick summary on the proposed implementation strategy:
- Make one-time single pass through all views and set new SYSTEM.CATALOG 
BASE_COLUMN_COUNT column for how many columns are from the base table. We can 
do this in ConnectionQueryServicesImpl.init() upon first connection to a 
cluster that hasn't been upgraded.
- In MetaDataEndPointImpl, when a column is added to a base table with views, 
instead of failing, we'll add the same column, in the same position to any 
views that have the same number of columns inherited from the base table.
- In MetaDataEndPointImpl, when a column is added to a view, take a lock out on 
the physical table to prevent any race conditions.
- Prevent the removal of any of the first N columns (where N is the number of 
columns inherited from the base table) from a view.

This assumes that all metadata is in a single region (as otherwise you wouldn't 
be able to take a lock out for the parent table when a view is updated). Longer 
term we'll likely make DDL operations transactional so we can relax this 
constraint. We could optionally add a custom split policy to prevent any splits 
from occurring.

> Allow schema changes to table with views
> ----------------------------------------
>
>                 Key: PHOENIX-1504
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1504
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: James Taylor
>            Assignee: Dave Hacker
>
> We currently disallow any schema modifications to a table that has views. We 
> should relax that constraint and push the schema change as necessary out to 
> all views.



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

Reply via email to