This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new cd6808bc8 [core] Check bucket only cache enabled for scan in write
cd6808bc8 is described below
commit cd6808bc8c62a4b40a9bb01ff0a1969daab3aca2
Author: Jingsong <[email protected]>
AuthorDate: Sun Aug 11 20:02:37 2024 +0800
[core] Check bucket only cache enabled for scan in write
---
.../src/main/java/org/apache/paimon/manifest/ManifestFile.java | 4 ++++
.../main/java/org/apache/paimon/operation/AbstractFileStoreScan.java | 2 +-
.../src/test/java/org/apache/paimon/utils/SnapshotManagerTest.java | 4 ----
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git
a/paimon-core/src/main/java/org/apache/paimon/manifest/ManifestFile.java
b/paimon-core/src/main/java/org/apache/paimon/manifest/ManifestFile.java
index 2f5cb4f23..5bd558854 100644
--- a/paimon-core/src/main/java/org/apache/paimon/manifest/ManifestFile.java
+++ b/paimon-core/src/main/java/org/apache/paimon/manifest/ManifestFile.java
@@ -192,6 +192,10 @@ public class ManifestFile extends
ObjectsFile<ManifestEntry> {
this.cache = cache;
}
+ public boolean isCacheEnabled() {
+ return cache != null;
+ }
+
public ManifestFile create() {
RowType entryType =
VersionedObjectSerializer.versionType(ManifestEntry.schema());
return new ManifestFile(
diff --git
a/paimon-core/src/main/java/org/apache/paimon/operation/AbstractFileStoreScan.java
b/paimon-core/src/main/java/org/apache/paimon/operation/AbstractFileStoreScan.java
index 2c753e270..358a2722f 100644
---
a/paimon-core/src/main/java/org/apache/paimon/operation/AbstractFileStoreScan.java
+++
b/paimon-core/src/main/java/org/apache/paimon/operation/AbstractFileStoreScan.java
@@ -148,7 +148,7 @@ public abstract class AbstractFileStoreScan implements
FileStoreScan {
@Override
public FileStoreScan withPartitionBucket(BinaryRow partition, int bucket) {
- if (manifestCacheFilter != null) {
+ if (manifestCacheFilter != null &&
manifestFileFactory.isCacheEnabled()) {
checkArgument(
manifestCacheFilter.test(partition, bucket),
String.format(
diff --git
a/paimon-core/src/test/java/org/apache/paimon/utils/SnapshotManagerTest.java
b/paimon-core/src/test/java/org/apache/paimon/utils/SnapshotManagerTest.java
index b1e038480..0c17e2a5e 100644
--- a/paimon-core/src/test/java/org/apache/paimon/utils/SnapshotManagerTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/utils/SnapshotManagerTest.java
@@ -30,12 +30,8 @@ import org.junit.jupiter.api.io.TempDir;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
-import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicReference;
-import java.util.stream.Collectors;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;