This is an automated email from the ASF dual-hosted git repository. morrysnow 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 1da5de683c0 [enhance](mtmv)when drop temp partition, not trigger materialized view refresh (#40875) 1da5de683c0 is described below commit 1da5de683c0dd055972a42e467d0911031aa22fc Author: zhangdong <493738...@qq.com> AuthorDate: Thu Sep 19 15:19:47 2024 +0800 [enhance](mtmv)when drop temp partition, not trigger materialized view refresh (#40875) when drop temp partition, not trigger materialized view refresh --- .../main/java/org/apache/doris/datasource/InternalCatalog.java | 2 +- .../src/main/java/org/apache/doris/event/DropPartitionEvent.java | 9 ++++++++- fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVService.java | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java index 6569477ab9e..c3d7c74a615 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java @@ -2014,7 +2014,7 @@ public class InternalCatalog implements CatalogIf<Database> { // it does not affect the logic of deleting the partition try { Env.getCurrentEnv().getEventProcessor().processEvent( - new DropPartitionEvent(db.getCatalog().getId(), db.getId(), olapTable.getId())); + new DropPartitionEvent(db.getCatalog().getId(), db.getId(), olapTable.getId(), isTempPartition)); } catch (Throwable t) { // According to normal logic, no exceptions will be thrown, // but in order to avoid bugs affecting the original logic, all exceptions are caught diff --git a/fe/fe-core/src/main/java/org/apache/doris/event/DropPartitionEvent.java b/fe/fe-core/src/main/java/org/apache/doris/event/DropPartitionEvent.java index 598768aa8de..cea03e7ef79 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/event/DropPartitionEvent.java +++ b/fe/fe-core/src/main/java/org/apache/doris/event/DropPartitionEvent.java @@ -20,7 +20,14 @@ package org.apache.doris.event; import org.apache.doris.common.AnalysisException; public class DropPartitionEvent extends TableEvent { - public DropPartitionEvent(long ctlId, long dbId, long tableId) throws AnalysisException { + private boolean isTempPartition; + + public DropPartitionEvent(long ctlId, long dbId, long tableId, boolean isTempPartition) throws AnalysisException { super(EventType.DROP_PARTITION, ctlId, dbId, tableId); + this.isTempPartition = isTempPartition; + } + + public boolean isTempPartition() { + return isTempPartition; } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVService.java b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVService.java index 4b740b75ef8..278811d3a99 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVService.java +++ b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVService.java @@ -24,6 +24,7 @@ import org.apache.doris.catalog.TableIf; import org.apache.doris.common.AnalysisException; import org.apache.doris.common.DdlException; import org.apache.doris.common.MetaNotFoundException; +import org.apache.doris.event.DropPartitionEvent; import org.apache.doris.event.Event; import org.apache.doris.event.EventException; import org.apache.doris.event.EventListener; @@ -177,6 +178,9 @@ public class MTMVService implements EventListener { if (!(event instanceof TableEvent)) { return; } + if (event instanceof DropPartitionEvent && ((DropPartitionEvent) event).isTempPartition()) { + return; + } TableEvent tableEvent = (TableEvent) event; LOG.info("processEvent, Event: {}", event); TableIf table; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org