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 0d55170c5c [core] Fix that cannot get partition info if all files are
in level-0 when enable dv. (#6531)
0d55170c5c is described below
commit 0d55170c5cf043a47893804c7d9f2c9e22992cc2
Author: zhoulii <[email protected]>
AuthorDate: Wed Nov 5 17:43:50 2025 +0800
[core] Fix that cannot get partition info if all files are in level-0 when
enable dv. (#6531)
---
.../java/org/apache/paimon/table/system/PartitionsTable.java | 3 ++-
.../java/org/apache/paimon/flink/BatchFileStoreITCase.java | 10 ++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git
a/paimon-core/src/main/java/org/apache/paimon/table/system/PartitionsTable.java
b/paimon-core/src/main/java/org/apache/paimon/table/system/PartitionsTable.java
index 07efaf85a5..04d3490df8 100644
---
a/paimon-core/src/main/java/org/apache/paimon/table/system/PartitionsTable.java
+++
b/paimon-core/src/main/java/org/apache/paimon/table/system/PartitionsTable.java
@@ -182,7 +182,8 @@ public class PartitionsTable implements ReadonlyTable {
throw new IllegalArgumentException("Unsupported split: " +
split.getClass());
}
- List<PartitionEntry> partitions =
fileStoreTable.newScan().listPartitionEntries();
+ List<PartitionEntry> partitions =
+ fileStoreTable.newScan().withLevelFilter(level ->
true).listPartitionEntries();
@SuppressWarnings("unchecked")
CastExecutor<InternalRow, BinaryString> partitionCastExecutor =
diff --git
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/BatchFileStoreITCase.java
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/BatchFileStoreITCase.java
index 30b2e6d0fd..c5e394ca8b 100644
---
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/BatchFileStoreITCase.java
+++
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/BatchFileStoreITCase.java
@@ -1025,4 +1025,14 @@ public class BatchFileStoreITCase extends
CatalogITCaseBase {
sql("INSERT INTO test_table VALUES (1, 'A')");
assertThat(sql("SELECT * FROM `test_table$files`")).isNotEmpty();
}
+
+ @Test
+ public void testLevel0FileCanBeReadForPartitionsTable() {
+ sql(
+ "CREATE TABLE test_table (a int PRIMARY KEY NOT ENFORCED, b
string, dt string) "
+ + "PARTITIONED BY (dt)"
+ + "WITH ('deletion-vectors.enabled' = 'true',
'write-only' = 'true');");
+ sql("INSERT INTO test_table VALUES (1, 'A', '2024-12-01')");
+ assertThat(sql("SELECT * FROM `test_table$partitions`")).isNotEmpty();
+ }
}