This is an automated email from the ASF dual-hosted git repository.
vbalaji pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new d85b57e59d7 [HUDI-6896] HoodieAvroHFileReader.RecordIterator iteration
never terminates (#9789)
d85b57e59d7 is described below
commit d85b57e59d7c153e328ca4d74f704501475ffc7b
Author: Lokesh Jain <[email protected]>
AuthorDate: Tue Oct 31 04:03:12 2023 +0530
[HUDI-6896] HoodieAvroHFileReader.RecordIterator iteration never terminates
(#9789)
---
.../main/java/org/apache/hudi/io/storage/HoodieAvroHFileReader.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git
a/hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieAvroHFileReader.java
b/hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieAvroHFileReader.java
index af08cc85ef5..46350409414 100644
---
a/hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieAvroHFileReader.java
+++
b/hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieAvroHFileReader.java
@@ -678,6 +678,7 @@ public class HoodieAvroHFileReader extends
HoodieAvroFileReaderBase implements H
private final Schema readerSchema;
private IndexedRecord next = null;
+ private boolean eof = false;
RecordIterator(HFile.Reader reader, HFileScanner scanner, Schema
writerSchema, Schema readerSchema) {
this.reader = reader;
@@ -690,6 +691,10 @@ public class HoodieAvroHFileReader extends
HoodieAvroFileReaderBase implements H
public boolean hasNext() {
try {
// NOTE: This is required for idempotency
+ if (eof) {
+ return false;
+ }
+
if (next != null) {
return true;
}
@@ -702,6 +707,7 @@ public class HoodieAvroHFileReader extends
HoodieAvroFileReaderBase implements H
}
if (!hasRecords) {
+ eof = true;
return false;
}