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

    https://github.com/apache/phoenix/pull/12#discussion_r17709795
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java ---
    @@ -937,24 +993,43 @@ public static PTable 
createFromProto(PTableProtos.PTable table) {
             PColumn column = columns.get(i);
             builder.addColumns(PColumnImpl.toProto(column));
           }
    +      
    +      List<PColumnFamily> cfs = table.getColumnFamilies();
    +      int familySize = cfs.size();
    +      List<PTableProtos.PColumn> cNames = 
Lists.newArrayListWithCapacity(columnSize);
    +      for (int i = 0; i < familySize; i++) {
    +          PColumnFamily pColumnFamily = cfs.get(i);
    +          for (int j = offset; j < columnSize; j++) {
    +              // TODO : Optimize here
    +              PColumn column = columns.get(j);
    +              if (column.getFamilyName() != null) {
    +                  if (Bytes.equals(column.getFamilyName().getBytes(), 
pColumnFamily.getName().getBytes())) {
    +                       cNames.add(PColumnImpl.toProto(column));
    +                  }
    +              }
    +          }
    +          
builder.addColumnfamilies(PColumnFamilyImpl.toProto(pColumnFamily, cNames));
    +          cNames.clear();
    +      }
           List<PTable> indexes = table.getIndexes();
           for (PTable curIndex : indexes) {
             builder.addIndexes(toProto(curIndex));
           }
           builder.setIsImmutableRows(table.isImmutableRows());
     
    -      // build stats
    -      Map<String, byte[][]> statsMap = 
table.getTableStats().getGuidePosts();
    --- End diff --
    
    This looks like it'll pretty much still work to build the PTableStats


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to