jackylk commented on a change in pull request #3568: [CARBONDATA-3658] Prune and Cache only Matched partitioned segments for filter on Partitioned table URL: https://github.com/apache/carbondata/pull/3568#discussion_r365522109
########## File path: core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletDataMapFactory.java ########## @@ -136,9 +136,22 @@ public DataMapBuilder createBuilder(Segment segment, String shardName, getTableBlockIndexUniqueIdentifiers(segment); for (TableBlockIndexUniqueIdentifier tableBlockIndexUniqueIdentifier : identifiers) { - tableBlockIndexUniqueIdentifierWrappers.add( - new TableBlockIndexUniqueIdentifierWrapper(tableBlockIndexUniqueIdentifier, - this.getCarbonTable())); + if (null != partitionsToPrune && !partitionsToPrune.isEmpty()) { + // add only tableBlockUniqueIdentifier that matches the partition + for (PartitionSpec partitionSpec : partitionsToPrune) { + if (partitionSpec.getLocation().toString() + .equalsIgnoreCase(tableBlockIndexUniqueIdentifier.getIndexFilePath())) { Review comment: It is not easy to understand why comparing partition spec location with index file path, can you make it more readable ---------------------------------------------------------------- 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 With regards, Apache Git Services