phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas D'Silva (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-5261) Implement ALTER TABLE ADD COLUMN CASCADE
Date Thu, 16 May 2019 05:22:00 GMT

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

Thomas D'Silva commented on PHOENIX-5261:
-----------------------------------------

For non diverged views (where you didn't drop a column inherited from the base table) adding
a column to a parent will propagate to all child views (including tenant specific ones). Maybe
the syntax should be CASCADE_INDEX to make clear that the column will be added to indexes.



> Implement ALTER TABLE ADD COLUMN CASCADE
> ----------------------------------------
>
>                 Key: PHOENIX-5261
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5261
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Geoffrey Jacoby
>            Assignee: Swaroopa Kadam
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Phoenix currently gives no way to alter the columns in an index. This is because adding
a column to an index would require a full rebuild to cycle through the parent table and add
the values to the index. 
> There is a special case, however, when adding a column to an index would be very useful
and easy, and that is when adding a new nullable field to the index's parent table. In this
case it is safe to just go ahead and add the column to the index, because at DDL time the
field is known to be NULL on each row. 
> I propose adding an optional parameter CASCADE to ALTER TABLE ADD COLUMN, which when
used will do the following:
> 1. The new column will be automatically added to any child views.
> 2. The new column will be automatically added as an INCLUDED column in any secondary
index belonging to the parent table. 
> Outstanding questions:
> 1. Does splittable system catalog already take care of Item 1?
> 2. What about tenant-owned views?
> 3. Should there be a way to exclude adding the column to a child index to allow for uncovered
usage?  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message