kadirozde commented on a change in pull request #1159: URL: https://github.com/apache/phoenix/pull/1159#discussion_r590825226
########## File path: phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java ########## @@ -491,6 +476,22 @@ private static void optimizeProjection(StatementContext context, Scan scan, PTab } } } + for (Entry<byte[], NavigableSet<byte[]>> entry : familyMap.entrySet()) { + ImmutableBytesPtr cf = new ImmutableBytesPtr(entry.getKey()); + NavigableSet<byte[]> qs = entry.getValue(); + NavigableSet<ImmutableBytesPtr> cols = null; + if (qs != null) { + cols = new TreeSet<ImmutableBytesPtr>(); + for (byte[] q : qs) { + cols.add(new ImmutableBytesPtr(q)); + if (trackedColumnsBitset != null) { + int qualifier = encodingScheme.decode(q); + trackedColumnsBitset.set(qualifier); + } + } + } + columnsTracker.put(cf, cols); + } Review comment: I think the side effect of moving this code block here would be adding some extra columns to the result set. I do not think that would create a functional issue but just result in more data to return to the client. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org