You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by GitBox <gi...@apache.org> on 2021/09/01 06:36:16 UTC

[GitHub] [carbondata] maheshrajus commented on a change in pull request #4209: [CARBONDATA-4278] Avoid refetching all indexes to get segment properties

maheshrajus commented on a change in pull request #4209:
URL: https://github.com/apache/carbondata/pull/4209#discussion_r699885987



##########
File path: core/src/main/java/org/apache/carbondata/core/index/TableIndex.java
##########
@@ -207,15 +208,22 @@ public CarbonTable getTable() {
       Map<Segment, List<Index>> indexes) throws IOException {
     Set<String> missingSISegments = filter.getMissingSISegments();
     for (Segment segment : segments) {
+      List<Index> segmentIndices = indexes.get(segment);
       if (segment == null ||
-          indexes.get(segment) == null || indexes.get(segment).isEmpty()) {
+          indexes.get(segment) == null || segmentIndices.isEmpty()) {
         continue;
       }
       boolean isExternalOrMissingSISegment = segment.isExternalSegment() ||
           (missingSISegments != null && missingSISegments.contains(segment.getSegmentNo()));
       List<Blocklet> pruneBlocklets = new ArrayList<>();
-      SegmentProperties segmentProperties =
-          segmentPropertiesFetcher.getSegmentProperties(segment, partitionLocations);
+      SegmentProperties segmentProperties;
+      if (segmentIndices.get(0) instanceof BlockIndex) {

Review comment:
       @ajantha-bhat  @Indhumathi27 1) we are getting segment properties from one blockindex which is same for all. 
   2) In this flow we may receive SI and bloom indexes also which will prepare by SI , bloom index factory [List(SecondaryIndex) or List(BloomIndex)]. In this case we should use "segmentPropertiesFetcher.getSegmentProperties" as they are not instance of BlockIndex. inside getSegmentProperties method we are getting and preparing list of BlockIndex and getting segment propteries from block index.
   
   I will add scenario description in code and push.




-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@carbondata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org