Github user JamesRTaylor commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/12#discussion_r17772137
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java ---
@@ -937,24 +978,37 @@ public static PTable
createFromProto(PTableProtos.PTable table) {
PColumn column = columns.get(i);
builder.addColumns(PColumnImpl.toProto(column));
}
+
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();
- if(statsMap != null) {
- for (Entry<String, byte[][]> entry : statsMap.entrySet()) {
- PTableProtos.PTableStats.Builder statsBuilder =
PTableProtos.PTableStats.newBuilder();
- statsBuilder.setKey(entry.getKey());
- for (byte[] curVal : entry.getValue()) {
- statsBuilder.addValues(HBaseZeroCopyByteString.wrap(curVal));
- }
- builder.addGuidePosts(statsBuilder.build());
- }
- }
+ // build stats for the table
+ if (table.getColumnFamilies().isEmpty() && table.getGuidePosts() !=
null) {
--- End diff --
Change to && !table.getGuidePosts().isEmpty()
---
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.
---