carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [carbondata] branch master updated: [CARBONDATA-3391] Count star output is wrong when BLOCKLET CACHE is enabled
Date Thu, 16 May 2019 19:00:12 GMT
This is an automated email from the ASF dual-hosted git repository.

ravipesala 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 5a4684f  [CARBONDATA-3391] Count star output is wrong when BLOCKLET CACHE is enabled
5a4684f is described below

commit 5a4684f7f085fbad08f37b1cb1c6974b886e0e4c
Author: BJangir <babulaljangir111@gmail.com>
AuthorDate: Thu May 16 14:53:21 2019 +0530

    [CARBONDATA-3391] Count star output is wrong when BLOCKLET CACHE is enabled
    
    Wrong Cont(*) value when blocklet cache is enabled
    Root cause :- blockletToRowCountMap has key with segmentNo+carbonfile name . so when carbonfile
has multiple blocklets , blockletToRowCountMap overrites existing rowcount.
    
    Solution :- update the existing rowcount if any.
    
    This closes #3225
---
 .../carbondata/core/indexstore/blockletindex/BlockDataMap.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockDataMap.java
b/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockDataMap.java
index 1fc5831..13e612d 100644
--- a/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockDataMap.java
+++ b/core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockDataMap.java
@@ -689,7 +689,13 @@ public class BlockDataMap extends CoarseGrainDataMap
           CarbonCommonConstants.DEFAULT_CHARSET_CLASS) + CarbonTablePath.getCarbonDataExtension();
       int rowCount = dataMapRow.getInt(ROW_COUNT_INDEX);
       // prepend segment number with the blocklet file path
-      blockletToRowCountMap.put((segment.getSegmentNo() + "," + fileName), (long) rowCount);
+      String blockletMapKey = segment.getSegmentNo() + "," + fileName;
+      Long existingCount = blockletToRowCountMap.get(blockletMapKey);
+      if (null != existingCount) {
+        blockletToRowCountMap.put(blockletMapKey, (long) rowCount + existingCount);
+      } else {
+        blockletToRowCountMap.put(blockletMapKey, (long) rowCount);
+      }
     }
     return blockletToRowCountMap;
   }


Mime
View raw message