[
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)