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 c021fd26bc35d8..12d59c3ca1ab1f 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 @@ private void calculateTaskUpdateRows(Map> tableIdToTabletD LOG.info("Task backend id {}, update rows info : [{}]", task.getBackendId(), task.getTableIdToTabletDeltaRows()); for (Entry> tableEntry : task.getTableIdToTabletDeltaRows().entrySet()) { - if (tableIdToTabletDeltaRows.containsKey(tableEntry.getKey())) { - Map tabletsDelta = tableIdToTabletDeltaRows.get(tableEntry.getKey()); - for (Entry 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 tabletsDelta = tableIdToTabletDeltaRows.get(tableEntry.getKey()); + for (Entry tabletEntry : tableEntry.getValue().entrySet()) { + tabletsDelta.computeIfPresent(tabletEntry.getKey(), + (tabletId, origRows) -> origRows + tabletEntry.getValue()); + tabletsDelta.putIfAbsent(tabletEntry.getKey(), tabletEntry.getValue()); } } }