This is an automated email from the ASF dual-hosted git repository.

JingsongLi 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 ec1d8ee8ac [hotfix] Fix test error from Limit PR merging
ec1d8ee8ac is described below

commit ec1d8ee8ac9c67972ac148e132f8e6c2952afee0
Author: JingsongLi <[email protected]>
AuthorDate: Mon Jul 13 13:06:33 2026 +0800

    [hotfix] Fix test error from Limit PR merging
---
 .../apache/paimon/reader/LimitRecordReader.java    | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git 
a/paimon-common/src/main/java/org/apache/paimon/reader/LimitRecordReader.java 
b/paimon-common/src/main/java/org/apache/paimon/reader/LimitRecordReader.java
index 59e1a767b8..256453497f 100644
--- 
a/paimon-common/src/main/java/org/apache/paimon/reader/LimitRecordReader.java
+++ 
b/paimon-common/src/main/java/org/apache/paimon/reader/LimitRecordReader.java
@@ -47,6 +47,7 @@ public final class LimitRecordReader<T> implements 
RecordReader<T> {
 
     @Override
     @Nullable
+    @SuppressWarnings("unchecked")
     public RecordIterator<T> readBatch() throws IOException {
         if (recordCount.get() >= limit) {
             return null;
@@ -55,6 +56,9 @@ public final class LimitRecordReader<T> implements 
RecordReader<T> {
         if (iterator == null) {
             return null;
         }
+        if (iterator instanceof ScoreRecordIterator) {
+            return new LimitScoreRecordIterator<>((ScoreRecordIterator<T>) 
iterator);
+        }
         return new LimitRecordIterator<>(iterator);
     }
 
@@ -89,4 +93,25 @@ public final class LimitRecordReader<T> implements 
RecordReader<T> {
             iterator.releaseBatch();
         }
     }
+
+    private class LimitScoreRecordIterator<T> extends LimitRecordIterator<T>
+            implements ScoreRecordIterator<T> {
+
+        private final ScoreRecordIterator<T> iterator;
+
+        private LimitScoreRecordIterator(ScoreRecordIterator<T> iterator) {
+            super(iterator);
+            this.iterator = iterator;
+        }
+
+        @Override
+        public float returnedScore() {
+            return iterator.returnedScore();
+        }
+
+        @Override
+        public long returnedRowId() {
+            return iterator.returnedRowId();
+        }
+    }
 }

Reply via email to