You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/03/18 02:53:43 UTC

[GitHub] [carbondata] qiuchenjian commented on a change in pull request #3148: [CARBONDATA-3293] Prune datamaps improvement for count(*)

qiuchenjian commented on a change in pull request #3148: [CARBONDATA-3293] Prune datamaps improvement for count(*)
URL: https://github.com/apache/carbondata/pull/3148#discussion_r266281719
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockDataMap.java
 ##########
 @@ -648,6 +654,42 @@ protected int getTotalBlocklets() {
     return sum;
   }
 
+  public Map<String, Long> getRowCount(List<PartitionSpec> partitions,
+      Map<String, Long> blockletToRowCountMap, boolean isUpdateFlow)
+      throws IOException {
+    if (taskSummaryDMStore.getRowCount() == 0) {
+      return new HashMap<>();
+    }
+    // if it has partitioned datamap but there is no partitioned information stored, it means
+    // partitions are dropped so return empty list.
+    if (partitions != null) {
+      if (!validatePartitionInfo(partitions)) {
+        return new HashMap<>();
+      }
+    }
+    Iterator<Map.Entry<String, Integer>> iterator =
+        taskSummaryDMStore.getRowCountMap().entrySet().iterator();
+    if (!isUpdateFlow) {
+      long totalSize = 0;
+      while (iterator.hasNext()) {
+        Map.Entry<String, Integer> next = iterator.next();
+        totalSize += next.getValue();
+      }
+      Long rowCount = blockletToRowCountMap.get("RowCount");
 
 Review comment:
   Better to change "RowCount" to a constant

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services