This is an automated email from the ASF dual-hosted git repository.
junhao 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 7da995126d [core] DataEvolutionFileStoreScan should not filter files
by read type when it contains no physical columns. (#6714)
7da995126d is described below
commit 7da995126d1feaf7f4b93d4a926231f63167fcf1
Author: Faiz <[email protected]>
AuthorDate: Tue Dec 2 12:00:38 2025 +0800
[core] DataEvolutionFileStoreScan should not filter files by read type when
it contains no physical columns. (#6714)
---
.../operation/DataEvolutionFileStoreScan.java | 11 +++++++--
.../paimon/table/DataEvolutionTableTest.java | 28 ++++++++++++++++++++++
2 files changed, 37 insertions(+), 2 deletions(-)
diff --git
a/paimon-core/src/main/java/org/apache/paimon/operation/DataEvolutionFileStoreScan.java
b/paimon-core/src/main/java/org/apache/paimon/operation/DataEvolutionFileStoreScan.java
index 97812d8ffb..3423b181f6 100644
---
a/paimon-core/src/main/java/org/apache/paimon/operation/DataEvolutionFileStoreScan.java
+++
b/paimon-core/src/main/java/org/apache/paimon/operation/DataEvolutionFileStoreScan.java
@@ -32,6 +32,7 @@ import org.apache.paimon.reader.DataEvolutionRow;
import org.apache.paimon.schema.SchemaManager;
import org.apache.paimon.schema.TableSchema;
import org.apache.paimon.stats.SimpleStats;
+import org.apache.paimon.table.SpecialFields;
import org.apache.paimon.types.DataField;
import org.apache.paimon.types.RowType;
import org.apache.paimon.utils.RangeHelper;
@@ -127,8 +128,14 @@ public class DataEvolutionFileStoreScan extends
AppendOnlyFileStoreScan {
@Override
public FileStoreScan withReadType(RowType readType) {
- if (readType != null && !readType.getFields().isEmpty()) {
- this.readType = readType;
+ if (readType != null) {
+ List<DataField> nonSystemFields =
+ readType.getFields().stream()
+ .filter(f -> !SpecialFields.isSystemField(f.id()))
+ .collect(Collectors.toList());
+ if (!nonSystemFields.isEmpty()) {
+ this.readType = readType;
+ }
}
return this;
}
diff --git
a/paimon-core/src/test/java/org/apache/paimon/table/DataEvolutionTableTest.java
b/paimon-core/src/test/java/org/apache/paimon/table/DataEvolutionTableTest.java
index b094dc2604..88c68b62d2 100644
---
a/paimon-core/src/test/java/org/apache/paimon/table/DataEvolutionTableTest.java
+++
b/paimon-core/src/test/java/org/apache/paimon/table/DataEvolutionTableTest.java
@@ -109,6 +109,34 @@ public class DataEvolutionTableTest extends TableTestBase {
assertThat(r.getString(1).toString()).isEqualTo("a");
assertThat(r.getString(2).toString()).isEqualTo("c");
});
+
+ // projection with only special fields.
+ readBuilder = getTableDefault().newReadBuilder();
+ reader =
+ readBuilder
+ .withReadType(RowType.of(SpecialFields.ROW_ID))
+ .newRead()
+ .createReader(readBuilder.newScan().plan());
+ AtomicInteger cnt = new AtomicInteger(0);
+ reader.forEachRemaining(
+ r -> {
+ cnt.incrementAndGet();
+ });
+ assertThat(cnt.get()).isEqualTo(1);
+
+ // projection with an empty read type
+ readBuilder = getTableDefault().newReadBuilder();
+ reader =
+ readBuilder
+ .withReadType(RowType.of())
+ .newRead()
+ .createReader(readBuilder.newScan().plan());
+ AtomicInteger cnt1 = new AtomicInteger(0);
+ reader.forEachRemaining(
+ r -> {
+ cnt1.incrementAndGet();
+ });
+ assertThat(cnt1.get()).isEqualTo(1);
}
@Test