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

    https://github.com/apache/phoenix/pull/304#discussion_r194546247
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 ---
    @@ -767,50 +748,117 @@ private void 
modifyColumnFamilyDescriptor(HColumnDescriptor hcd, Map<String,Obje
             }
         }
     
    +    /**
    +     * Check that the specific set of column family properties mentioned 
in {@link MetaDataUtil#PROPERTIES_TO_KEEP_IN_SYNC_AMONG_COL_FAMS_AND_INDEXES}
    +     * are in sync for the given table (this includes the local index 
column family).
    +     * @param tableName
    +     * @param defaultFamilyBytes
    +     * @return default column descriptor used for checking if properties 
are synced or not, and the synced table descriptor
    +     * @throws SQLException
    +     */
    +    private Pair<HColumnDescriptor, HTableDescriptor> 
ensureTableColumnFamilyPropsInSync(String tableName, byte[] defaultFamilyBytes) 
throws SQLException {
    +        HTableDescriptor tableDescriptor = 
getTableDescriptor(Bytes.toBytes(tableName));
    +        HColumnDescriptor[] colFamilies = 
tableDescriptor.getColumnFamilies();
    +        HColumnDescriptor  defaultColDescriptor = 
tableDescriptor.getFamily(defaultFamilyBytes);
    +        // It's possible that the table has specific column families and 
none of them are declared to be the DEFAULT_COLUMN_FAMILY
    +        defaultColDescriptor = defaultColDescriptor != null ? 
defaultColDescriptor : colFamilies[0];
    +
    +        for (String propName: 
MetaDataUtil.PROPERTIES_TO_KEEP_IN_SYNC_AMONG_COL_FAMS_AND_INDEXES) {
    +            if (defaultColDescriptor.getValue(propName) == null) {
    --- End diff --
    
    Do you need to throw UpgradeRequiredException  if the default column table 
property is null here?


---

Reply via email to