This is an automated email from the ASF dual-hosted git repository.
lijibing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 7caddd039f2 [fix](statistics)Fix update rows bug. (#39368)
7caddd039f2 is described below
commit 7caddd039f24b13ab9879258aa4f40eaae187ea3
Author: Jibing-Li <[email protected]>
AuthorDate: Thu Aug 15 11:34:37 2024 +0800
[fix](statistics)Fix update rows bug. (#39368)
Fix update rows bug. Need to new a hashmap to store the tablet id to row
count entry. Otherwise the row count is not accurate.
---
.../apache/doris/transaction/PublishVersionDaemon.java | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/transaction/PublishVersionDaemon.java
b/fe/fe-core/src/main/java/org/apache/doris/transaction/PublishVersionDaemon.java
index c021fd26bc3..12d59c3ca1a 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/transaction/PublishVersionDaemon.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/transaction/PublishVersionDaemon.java
@@ -256,15 +256,12 @@ public class PublishVersionDaemon extends MasterDaemon {
LOG.info("Task backend id {}, update rows info : [{}]",
task.getBackendId(), task.getTableIdToTabletDeltaRows());
for (Entry<Long, Map<Long, Long>> tableEntry :
task.getTableIdToTabletDeltaRows().entrySet()) {
- if (tableIdToTabletDeltaRows.containsKey(tableEntry.getKey()))
{
- Map<Long, Long> tabletsDelta =
tableIdToTabletDeltaRows.get(tableEntry.getKey());
- for (Entry<Long, Long> tabletEntry :
tableEntry.getValue().entrySet()) {
- tabletsDelta.computeIfPresent(tabletEntry.getKey(),
- (tabletId, origRows) -> origRows +
tabletEntry.getValue());
- tabletsDelta.putIfAbsent(tabletEntry.getKey(),
tabletEntry.getValue());
- }
- } else {
- tableIdToTabletDeltaRows.put(tableEntry.getKey(),
tableEntry.getValue());
+ tableIdToTabletDeltaRows.putIfAbsent(tableEntry.getKey(),
Maps.newHashMap());
+ Map<Long, Long> tabletsDelta =
tableIdToTabletDeltaRows.get(tableEntry.getKey());
+ for (Entry<Long, Long> tabletEntry :
tableEntry.getValue().entrySet()) {
+ tabletsDelta.computeIfPresent(tabletEntry.getKey(),
+ (tabletId, origRows) -> origRows +
tabletEntry.getValue());
+ tabletsDelta.putIfAbsent(tabletEntry.getKey(),
tabletEntry.getValue());
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]