dhatchayani commented on a change in pull request #3148: [CARBONDATA-3293] Prune datamaps improvement for count(*)
URL:
https://github.com/apache/carbondata/pull/3148#discussion_r266786675
##########
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:
done
----------------------------------------------------------------
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:
[hidden email]
With regards,
Apache Git Services