morrySnow commented on code in PR #43959: URL: https://github.com/apache/doris/pull/43959#discussion_r1848213463
########## fe/fe-core/src/main/java/org/apache/doris/catalog/MTMV.java: ########## @@ -190,15 +190,19 @@ public MTMVStatus alterStatus(MTMVStatus newStatus) { } public void addTaskResult(MTMVTask task, MTMVRelation relation, - Map<String, MTMVRefreshPartitionSnapshot> partitionSnapshots) { + Map<String, MTMVRefreshPartitionSnapshot> partitionSnapshots, boolean isReplay) { MTMVCache mtmvCache = null; boolean needUpdateCache = false; if (task.getStatus() == TaskStatus.SUCCESS && !Env.isCheckpointThread() && !Config.enable_check_compatibility_mode) { needUpdateCache = true; try { - // shouldn't do this while holding mvWriteLock - mtmvCache = MTMVCache.from(this, MTMVPlanUtil.createMTMVContext(this), true); + // The replay thread may not have initialized the catalog yet to avoid getting stuck due + // to connection issues such as S3, so it is directly set to null + if (!isReplay) { + // shouldn't do this while holding mvWriteLock + mtmvCache = MTMVCache.from(this, MTMVPlanUtil.createMTMVContext(this), true); + } Review Comment: need a standalone pr? ########## fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalTable.java: ########## @@ -73,18 +95,95 @@ public Table getPaimonTable() { return schemaCacheValue.map(value -> ((PaimonSchemaCacheValue) value).getPaimonTable()).orElse(null); } + public PaimonPartitionInfo getPartitionInfoFromCache() { Review Comment: private? ########## fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonPartition.java: ########## @@ -0,0 +1,55 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.datasource.paimon; + +public class PaimonPartition { + private String partitionValues; + private long recordCount; + private long fileSizeInBytes; + private long fileCount; + private long lastUpdateTime; Review Comment: add comment to explain these attributes. ########## fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonPartition.java: ########## @@ -0,0 +1,55 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.datasource.paimon; + +public class PaimonPartition { + private String partitionValues; + private long recordCount; + private long fileSizeInBytes; + private long fileCount; + private long lastUpdateTime; Review Comment: make them final ########## fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalTable.java: ########## @@ -73,18 +95,95 @@ public Table getPaimonTable() { return schemaCacheValue.map(value -> ((PaimonSchemaCacheValue) value).getPaimonTable()).orElse(null); } + public PaimonPartitionInfo getPartitionInfoFromCache() { + makeSureInitialized(); + Optional<SchemaCacheValue> schemaCacheValue = getSchemaCacheValue(); + if (!schemaCacheValue.isPresent()) { + return new PaimonPartitionInfo(); + } + return ((PaimonSchemaCacheValue) schemaCacheValue.get()).getPartitionInfo(); + } + + public List<Column> getPartitionColumnsFromCache() { Review Comment: private? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org