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

    https://github.com/apache/phoenix/pull/127#discussion_r44852247
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 ---
    @@ -1936,29 +2278,32 @@ public Void call() throws Exception {
                                     long currentServerSideTableTimeStamp = 
e.getTable().getTimeStamp();
     
                                     String columnsToAdd = "";
    -                                if(currentServerSideTableTimeStamp < 
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_3_0) {
    -                                    // We know that we always need to add 
the STORE_NULLS column for 4.3 release
    -                                    columnsToAdd = ", " + 
PhoenixDatabaseMetaData.STORE_NULLS + " " + PBoolean.INSTANCE.getSqlTypeName();
    -                                    HBaseAdmin admin = null;
    -                                    try {
    -                                        admin = getAdmin();
    -                                        HTableDescriptor[] 
localIndexTables = admin.listTables(MetaDataUtil.LOCAL_INDEX_TABLE_PREFIX+".*");
    -                                        for (HTableDescriptor table : 
localIndexTables) {
    -                                            if 
(table.getValue(MetaDataUtil.PARENT_TABLE_KEY) == null
    -                                                    && 
table.getValue(MetaDataUtil.IS_LOCAL_INDEX_TABLE_PROP_NAME) != null) {
    -                                                
table.setValue(MetaDataUtil.PARENT_TABLE_KEY,
    -                                                    
MetaDataUtil.getUserTableName(table
    -                                                        
.getNameAsString()));
    -                                                // Explicitly disable, 
modify and enable the table to ensure co-location of data
    -                                                // and index regions. If 
we just modify the table descriptor when online schema
    -                                                // change enabled may 
reopen the region in same region server instead of following data region.
    -                                                
admin.disableTable(table.getTableName());
    -                                                
admin.modifyTable(table.getTableName(), table);
    -                                                
admin.enableTable(table.getTableName());
    +                                if(currentServerSideTableTimeStamp < 
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_6_0) {
    +                                    columnsToAdd = 
PhoenixDatabaseMetaData.TRANSACTIONAL + " " + 
PBoolean.INSTANCE.getSqlTypeName();
    +                                    if(currentServerSideTableTimeStamp < 
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_3_0) {
    +                                        // We know that we always need to 
add the STORE_NULLS column for 4.3 release
    +                                        columnsToAdd += "," + 
PhoenixDatabaseMetaData.STORE_NULLS + " " + PBoolean.INSTANCE.getSqlTypeName();
    +                                        HBaseAdmin admin = null;
    +                                        try {
    +                                            admin = getAdmin();
    +                                            HTableDescriptor[] 
localIndexTables = admin.listTables(MetaDataUtil.LOCAL_INDEX_TABLE_PREFIX+".*");
    +                                            for (HTableDescriptor table : 
localIndexTables) {
    +                                                if 
(table.getValue(MetaDataUtil.PARENT_TABLE_KEY) == null
    +                                                        && 
table.getValue(MetaDataUtil.IS_LOCAL_INDEX_TABLE_PROP_NAME) != null) {
    +                                                    
table.setValue(MetaDataUtil.PARENT_TABLE_KEY,
    +                                                        
MetaDataUtil.getUserTableName(table
    +                                                            
.getNameAsString()));
    +                                                    // Explicitly disable, 
modify and enable the table to ensure co-location of data
    +                                                    // and index regions. 
If we just modify the table descriptor when online schema
    +                                                    // change enabled may 
reopen the region in same region server instead of following data region.
    +                                                    
admin.disableTable(table.getTableName());
    +                                                    
admin.modifyTable(table.getTableName(), table);
    +                                                    
admin.enableTable(table.getTableName());
    +                                                }
                                                 }
    +                                        } finally {
    +                                            if (admin != null) 
admin.close();
                                             }
    -                                    } finally {
    -                                        if (admin != null) admin.close();
                                         }
                                     }
     
    --- End diff --
    
    You'll need to add an if statement in init() in the MetaDataClient.java and 
a MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_7_0  for conditionally adding 
the new TRANSACTIONAL column to SYSTEM.CATALOG.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to