This is an automated email from the ASF dual-hosted git repository.

ajantha pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git


The following commit(s) were added to refs/heads/master by this push:
     new 8509af0  [HOTFIX] Fix Repeated access to getSegmentProperties
8509af0 is described below

commit 8509af0b3a447715104b2ba3326d1762047615c3
Author: haomarch <[email protected]>
AuthorDate: Sat Apr 4 22:35:43 2020 +0800

    [HOTFIX] Fix Repeated access to getSegmentProperties
    
    Why is this PR needed?
    getSegmentProperties is accessed repeated in query processing, which leads 
to heavy time overhead.
    
    What changes were proposed in this PR?
    Reuse the segmentProperty.
    
    Does this PR introduce any user interface change?
    No
    
    Is any new testcase added?
    No
    
    This closes #3696
---
 .../core/indexstore/blockletindex/BlockletIndexFactory.java         | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletIndexFactory.java
 
b/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletIndexFactory.java
index 46d7080..d8bf70a 100644
--- 
a/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletIndexFactory.java
+++ 
b/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletIndexFactory.java
@@ -653,9 +653,13 @@ public class BlockletIndexFactory extends 
CoarseGrainIndexFactory
       throws IOException {
     List<Blocklet> blocklets = new ArrayList<>();
     List<CoarseGrainIndex> dataMaps = getIndexes(segment, partitions);
+    if (dataMaps.size() == 0) {
+      return blocklets;
+    }
+    SegmentProperties segmentProperties = 
getSegmentPropertiesFromDataMap(dataMaps.get(0));
     for (CoarseGrainIndex dataMap : dataMaps) {
       blocklets.addAll(dataMap
-          .prune((FilterResolverIntf) null, getSegmentProperties(segment, 
partitions), partitions,
+          .prune((FilterResolverIntf) null, segmentProperties, partitions,
               null, this.getCarbonTable()));
     }
     return blocklets;

Reply via email to