[fix](statistics) NPE when drop partition during publish (pick #35475) (#35977)

skip null partition when get base tablets for each be (for further usage
in dedup updated row count in MV) This may cause publish fail

cherry pick master #35475
This commit is contained in:
zhengyu
2024-06-06 16:47:30 +08:00
committed by GitHub
parent 85328d4f79
commit fedb7e15a0

View File

@ -46,6 +46,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -219,7 +220,9 @@ public class PublishVersionDaemon extends MasterDaemon {
.getIdToPartitionCommitInfo()
.values().stream()
.map(PartitionCommitInfo::getPartitionId)
.map(table::getPartition)
.map(partitionId -> Optional.ofNullable(table.getPartition(partitionId)))
.filter(Optional::isPresent)
.map(Optional::get)
.map(Partition::getBaseIndex)
.map(MaterializedIndex::getTablets)
.flatMap(Collection::stream)