Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwenchi committed Feb 13, 2025
1 parent d277b8c commit ab31b52
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,7 @@ protected synchronized void makeSureInitialized() {
}

public Table getPaimonTable(Optional<MvccSnapshot> snapshot) {
PaimonSnapshot paimonSnapshot = getOrFetchSnapshotCacheValue(snapshot).getSnapshot();
Table table = paimonSnapshot.getTable();
// TODO mmc
// if (paimonSnapshot.getSnapshotId() == PaimonSnapshot.INVALID_SNAPSHOT_ID) {
// Env.getCurrentEnv().getExtMetaCacheMgr().getPaimonMetadataCache()
// .invalidateTableCache(catalog.getId(), dbName, name);
// }
return table;
return getOrFetchSnapshotCacheValue(snapshot).getSnapshot().getTable();
}

public PaimonSchemaCacheValue getPaimonSchemaCacheValue(long schemaId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@
package org.apache.doris.datasource.paimon;

import org.apache.doris.catalog.Column;
import org.apache.doris.catalog.Env;
import org.apache.doris.common.AnalysisException;
import org.apache.doris.common.CacheFactory;
import org.apache.doris.common.Config;
import org.apache.doris.datasource.CacheException;
import org.apache.doris.datasource.CatalogIf;
import org.apache.doris.datasource.ExternalMetaCacheMgr;
import org.apache.doris.datasource.ExternalSchemaCache;
import org.apache.doris.datasource.SchemaCacheValue;

import com.github.benmanes.caffeine.cache.LoadingCache;
import com.google.common.collect.Maps;
Expand All @@ -40,7 +37,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.OptionalLong;
import java.util.concurrent.ExecutorService;

Expand All @@ -66,15 +62,6 @@ private PaimonSnapshotCacheValue loadSnapshot(PaimonSnapshotCacheKey key) {
.getTableOrAnalysisException(key.getTableName());
List<Column> partitionColumns = table.getPaimonSchemaCacheValue(latestSnapshot.getSchemaId())
.getPartitionColumns();
// TODO mmc
// ExternalSchemaCache cache = Env.getCurrentEnv().getExtMetaCacheMgr().getSchemaCache(catalog);
// Optional<SchemaCacheValue> schemaCacheValue = cache.getSchemaValue(
// new PaimonSchemaCacheKey(dbName, name, schemaId));
// if (!schemaCacheValue.isPresent()) {
// throw new CacheException("failed to getSchema for: %s.%s.%s.%s",
// null, catalog.getName(), dbName, name, schemaId);
// }
// return (PaimonSchemaCacheValue) schemaCacheValue.get();
PaimonPartitionInfo partitionInfo = loadPartitionInfo(key, partitionColumns);
return new PaimonSnapshotCacheValue(partitionInfo, latestSnapshot);
} catch (IOException | AnalysisException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.google.common.collect.Sets;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.paimon.CoreOptions;
import org.apache.paimon.data.BinaryRow;
import org.apache.paimon.predicate.Predicate;
import org.apache.paimon.table.source.DataSplit;
Expand Down Expand Up @@ -207,6 +208,9 @@ public List<Split> getSplits(int numBackends) throws UserException {
SessionVariable.IgnoreSplitType ignoreSplitType = SessionVariable.IgnoreSplitType
.valueOf(sessionVariable.getIgnoreSplitType());
List<Split> splits = new ArrayList<>();
if (!source.getPaimonTable().options().containsKey(CoreOptions.SCAN_SNAPSHOT_ID.key())) {
return splits;
}
int[] projected = desc.getSlots().stream().mapToInt(
slot -> source.getPaimonTable().rowType()
.getFieldNames()
Expand Down

0 comments on commit ab31b52

Please sign in to comment.