You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2015/06/24 09:23:43 UTC

[jira] [Commented] (PHOENIX-2056) Ensure PK column from base table is added to any indexes on views

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

James Taylor commented on PHOENIX-2056:
---------------------------------------

+1 to both patches. Nice work, [~samarthjain]!

> Ensure PK column from base table is added to any indexes on views 
> ------------------------------------------------------------------
>
>                 Key: PHOENIX-2056
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2056
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: Samarth Jain
>         Attachments: PHOENIX-2056.patch, PHOENIX-2056_addendum.patch
>
>
> Given that we allow a nullable PK column to be added to a base table and push it to all views (PHOENIX-1504), we need to ensure that the PK column is also added to any indexes on the view. Without this, indexes on views would no longer maintain their 1:1 correspondence with data rows.
> Since the pushing of the new column is done under lock in MetaDataEndPointImpl and we have a PTable instantiated for each view, we can just iterate through its indexes (view.getIndexes()) and generate a couple of additional Puts: one for the PK column row in the index and one for the header row of the index table to increment the column count. The index table header row needs to be added to the list of rows to be invalidated as well.



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