You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Samarth Jain (JIRA)" <ji...@apache.org> on 2015/08/13 04:15:45 UTC

[jira] [Comment Edited] (PHOENIX-2177) Adding a column to the view shouldn't call admin.modifyTable() for the base table.

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

Samarth Jain edited comment on PHOENIX-2177 at 8/13/15 2:15 AM:
----------------------------------------------------------------

[~jamestaylor] - is it ok for an alter view statement to introduce a new column family? We allow that when adding a new column family to a physical table.

ALTER VIEW V ADD NEWCF.COL VARCHAR - should it be allowed?
ALTER TABLE T ADD NEWCF.COL VARCHAR - works

If yes, then we would need to conditionally call modifyTable(baseTable) when there is a new column family being added that doesn't already exist in the base table.
{code}
boolean newColumnFamilyAdded = !existingColumnFamilies(table.getPhysicalName()).containsAll(colFamiliesForPColumnsToBeAdded);
if (table.getType() != PTableType.VIEW || 
(table.getType() == PTableType.VIEW && newColumnFamilyAdded)) {
                    modifyTable(table.getPhysicalName().getBytes(), tableDescriptor, !pollingNotNeeded);
}
{code}


was (Author: samarthjain):
[~jamestaylor] - is it ok for an alter view statement to introduce a new column family? We allow that when adding a new column family to a physical table.

ALTER VIEW V ADD NEWCF.COL VARCHAR - should it be allowed?
ALTER TABLE T ADD NEWCF.COL VARCHAR - works

If yes, then we would need to conditionally call modifyTable(baseTable) when the number of column families to be added is > 0 like this:
{code}
if (table.getType() != PTableType.VIEW || 
(table.getType() == PTableType.VIEW && !colFamiliesForPColumnsToBeAdded.isEmpty())) {
                    modifyTable(table.getPhysicalName().getBytes(), tableDescriptor, !pollingNotNeeded);
}
{code}

> Adding a column to the view shouldn't call admin.modifyTable() for the base table.
> ----------------------------------------------------------------------------------
>
>                 Key: PHOENIX-2177
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2177
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Samarth Jain
>            Assignee: Samarth Jain
>             Fix For: 4.5.1
>
>         Attachments: PHOENIX-2177.patch
>
>




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