Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
zddr committed Nov 22, 2024
1 parent 127e597 commit 61b8bde
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 10 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/mtmv/BaseTableInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ public void setTableName(String tableName) {
this.tableName = tableName;
}

// if compatible failed due catalog dropped, ctlName will be null
public boolean isInternalTable() {
//
if (StringUtils.isEmpty(ctlName)) {
return InternalCatalog.INTERNAL_CATALOG_NAME.equals(ctlName);
} else {
return InternalCatalog.INTERNAL_CATALOG_ID == ctlId;
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down
3 changes: 1 addition & 2 deletions fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.apache.doris.common.MetaNotFoundException;
import org.apache.doris.common.util.TimeUtils;
import org.apache.doris.datasource.CatalogMgr;
import org.apache.doris.datasource.InternalCatalog;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.functions.executable.DateTimeExtractAndTransform;
import org.apache.doris.nereids.trees.expressions.literal.DateTimeV2Literal;
Expand Down Expand Up @@ -96,7 +95,7 @@ public static MTMV getMTMV(long dbId, long mtmvId) throws DdlException, MetaNotF
public static boolean mtmvContainsExternalTable(MTMV mtmv) {
Set<BaseTableInfo> baseTables = mtmv.getRelation().getBaseTablesOneLevel();
for (BaseTableInfo baseTableInfo : baseTables) {
if (!baseTableInfo.getCtlName().equals(InternalCatalog.INTERNAL_CATALOG_NAME)) {
if (!baseTableInfo.isInternalTable()) {
return true;
}
}
Expand Down

0 comments on commit 61b8bde

Please sign in to comment.