Github user twdsilva commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/329#discussion_r211437117
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
 ---
    @@ -3207,17 +3226,37 @@ public MetaDataMutationResult updateMutation(PTable 
table, byte[][] rowKeyMetaDa
                         } 
                         if (type == PTableType.VIEW
                                 && 
EncodedColumnsUtil.usesEncodedColumnNames(table)) {
    -                        /*
    -                         * When adding a column to a view that uses 
encoded column name scheme, we
    -                         * need to modify the CQ counters stored in the 
view's physical table. So to
    -                         * make sure clients get the latest PTable, we 
need to invalidate the cache
    -                         * entry.
    -                         */
    -                        invalidateList.add(new 
ImmutableBytesPtr(MetaDataUtil
    -                                .getPhysicalTableRowForView(table)));
    -
    -
    -
    +                                /*
    +                                 * When adding a column to a view that 
uses encoded column name
    +                                 * scheme, we need to modify the CQ 
counters stored in the view's
    +                                 * physical table. So to make sure clients 
get the latest PTable, we
    +                                 * need to invalidate the cache entry.
    +                                 */
    +                                invalidateList.add(new ImmutableBytesPtr(
    +                                        
MetaDataUtil.getPhysicalTableRowForView(table)));
    +                                byte[] parentSchemaName =
    +                                        
SchemaUtil.getSchemaNameFromFullName(
    +                                            
table.getPhysicalName().getString()).getBytes();
    +                                byte[] parentTableName =
    +                                        SchemaUtil
    +                                                .getTableNameFromFullName(
    +                                                    
(table.getPhysicalName().getString()))
    +                                                .getBytes();
    +                                PTable parentTable =
    +                                        doGetTable(null, parentSchemaName, 
parentTableName,
    --- End diff --
    
    As part of PHOENIX-3534 I modified doGetTable() to check if the table being 
looked up is on the current region, if its not it looks up the table using 
queryServices.getTable()


---

Reply via email to