Github user ajantha-bhat commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2936#discussion_r235846200 --- Diff: core/src/main/java/org/apache/carbondata/core/datamap/TableDataMap.java --- @@ -120,37 +132,166 @@ public BlockletDetailsFetcher getBlockletDetailsFetcher() { * @param filterExp * @return */ - public List<ExtendedBlocklet> prune(List<Segment> segments, FilterResolverIntf filterExp, - List<PartitionSpec> partitions) throws IOException { - List<ExtendedBlocklet> blocklets = new ArrayList<>(); - SegmentProperties segmentProperties; - Map<Segment, List<DataMap>> dataMaps = dataMapFactory.getDataMaps(segments); + public List<ExtendedBlocklet> prune(List<Segment> segments, final FilterResolverIntf filterExp, + final List<PartitionSpec> partitions) throws IOException { + final List<ExtendedBlocklet> blocklets = new ArrayList<>(); + final Map<Segment, List<DataMap>> dataMaps = dataMapFactory.getDataMaps(segments); + // for non-filter queries + if (filterExp == null) { + // if filter is not passed, then return all the blocklets. + return pruneWithoutFilter(segments, partitions, blocklets); + } + // for filter queries + int totalFiles = 0; + boolean isBlockDataMapType = true; + for (Segment segment : segments) { + for (DataMap dataMap : dataMaps.get(segment)) { + if (!(dataMap instanceof BlockDataMap)) { --- End diff -- This one, I have to figure out, number of entries in all kinds of datamap and need to test those scenario. I will handle in next PR
---