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

ASF GitHub Bot commented on PHOENIX-7067:
-----------------------------------------

jpisaac commented on code in PR #1709:
URL: https://github.com/apache/phoenix/pull/1709#discussion_r1385655483


##########
phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java:
##########
@@ -1598,12 +1600,14 @@ public MutationState createIndex(CreateIndexStatement 
statement, byte[][] splits
                 }
             }
 
+            Configuration config = 
connection.getQueryServices().getConfiguration();
             // for view indexes
             if (dataTable.getType() == PTableType.VIEW) {
                 String physicalName = dataTable.getPhysicalName().getString();
                 physicalSchemaName = 
SchemaUtil.getSchemaNameFromFullName(physicalName);
                 physicalTableName = 
SchemaUtil.getTableNameFromFullName(physicalName);
                 List<ColumnName> requiredCols = 
Lists.newArrayList(indexedColumnNames);
+                verifyIfDescViewsExtendPk(dataTable, config);

Review Comment:
   nit: method name, can get confused with Descending order. Maybe use full 
verb verifyIfDescendantViewsExtendsPk?





> View indexes should be created only on non overlapping updatable views
> ----------------------------------------------------------------------
>
>                 Key: PHOENIX-7067
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7067
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Jacob Isaac
>            Assignee: Viraj Jasani
>            Priority: Major
>
> Updatable views by definition outlined in PHOENIX-4555 are disjoint 
> partitions/virtual tables on the base HBase table.
> View indexes should only be allowed to be defined on these partitions.
> As PHOENIX-7047 revealed index rows are not generated or get clobbered for 
> certain multi-level views.
> This JIRA will try and address these issues and add the proper constraints on 
> when updatable views and view indexes can be created.
> 1. View should be allowed to extend the parent PK i.e. adding its own PK 
> column in the view definition only when there are no indexes in the parent 
> hierarchy.
> and vice versa
> 2. View indexes can defined on a given view only when there are no child 
> views that have extended the PK of the base view.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to