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

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

While adding parent indexes to a view table we check to ensure that all the 
view constant columns are present in the index so that we can add the view 
where clause to the index. If we create an index on a view v1 and then create a 
child view v2 that has the same view constants previously we would not be able 
to use the index (since the index doesn't contain the view constant columns of 
v1). So I added a check to see if the parent table of the index is a view and 
the column matches a view constant column in the parent index. 

Regarding your previous comment about having the getParentName() methods return 
the physicalName if the parentName is null for b/w compatibility.  In 
addIndexesFromPhysicalTable I have the following check.

{code}
+        // a view on a table will not have a parent name but will have a 
physical table name (which is the parent)
+        String parentName = view.getParentName()!=null ? 
view.getParentName().getString() : view.getPhysicalName().getString();
{code}

Would I still need to change getParentName() ?

> VIEW derived from another VIEW doesn't use parent VIEW indexes
> --------------------------------------------------------------
>
>                 Key: PHOENIX-1367
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1367
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: James Taylor
>            Assignee: Thomas D'Silva
>             Fix For: 4.9.0, 4.8.1
>
>         Attachments: PHOENIX-1369-4.x-HBase-0.98-v2.patch, 
> PHOENIX-1369-4.x-HBase-0.98.patch, PHOENIX_1367.test.patch
>
>
> If a VIEW has an index and another VIEW is derived from it, the child view 
> will not use the parent view's indexes.



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

Reply via email to