Indhumathi27 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_r366187992
##########
File path:
core/src/main/java/org/apache/carbondata/core/datamap/TableDataMap.java
##########
@@ -115,11 +115,20 @@ public CarbonTable getTable() {
final List<PartitionSpec> partitions) throws IOException {
final List<ExtendedBlocklet> blocklets = new ArrayList<>();
List<Segment> segments = getCarbonSegments(allsegments);
- final Map<Segment, List<DataMap>> dataMaps =
dataMapFactory.getDataMaps(segments);
+ final Map<Segment, List<DataMap>> dataMaps;
+ if (filter == null || filter.isEmpty() || partitions == null ||
partitions.isEmpty()) {
+ dataMaps = dataMapFactory.getDataMaps(segments);
+ } else {
+ dataMaps = dataMapFactory.getDataMaps(segments, partitions);
+ }
// for non-filter queries
// for filter queries
int totalFiles = 0;
int datamapsCount = 0;
+ // In case if filter has matched partitions, update the segment list
+ if (null != partitions && !partitions.isEmpty()) {
+ segments = new ArrayList<>(dataMaps.keySet());
+ }
Review comment:
It is still required here. All segment files needs to be cached
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services