This is an automated email from the ASF dual-hosted git repository.
huaxingao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/main by this push:
new 947a7b7913 API: Remove unnecessary EOFException in FileRange
constructor. (#15973)
947a7b7913 is described below
commit 947a7b7913d201544262fbc0a50784d23f3f5af5
Author: Mukund Thakur <[email protected]>
AuthorDate: Tue May 12 15:37:45 2026 -0500
API: Remove unnecessary EOFException in FileRange constructor. (#15973)
* API: Remove unnecessary EOFException FileRange constructor.
* Review comment
---
api/src/main/java/org/apache/iceberg/io/FileRange.java | 4 +---
.../main/java/org/apache/iceberg/parquet/ParquetIO.java | 17 ++++-------------
2 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/api/src/main/java/org/apache/iceberg/io/FileRange.java
b/api/src/main/java/org/apache/iceberg/io/FileRange.java
index 695d516725..78acf6374e 100644
--- a/api/src/main/java/org/apache/iceberg/io/FileRange.java
+++ b/api/src/main/java/org/apache/iceberg/io/FileRange.java
@@ -18,7 +18,6 @@
*/
package org.apache.iceberg.io;
-import java.io.EOFException;
import java.nio.ByteBuffer;
import java.util.concurrent.CompletableFuture;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
@@ -28,8 +27,7 @@ public class FileRange {
private final long offset;
private final int length;
- public FileRange(CompletableFuture<ByteBuffer> byteBuffer, long offset, int
length)
- throws EOFException {
+ public FileRange(CompletableFuture<ByteBuffer> byteBuffer, long offset, int
length) {
Preconditions.checkNotNull(byteBuffer, "byteBuffer can't be null");
Preconditions.checkArgument(length >= 0, "Invalid length: %s in range
(must be >= 0)", length);
Preconditions.checkArgument(offset >= 0, "Invalid offset: %s in range
(must be >= 0)", offset);
diff --git a/parquet/src/main/java/org/apache/iceberg/parquet/ParquetIO.java
b/parquet/src/main/java/org/apache/iceberg/parquet/ParquetIO.java
index 7e0c7f5f3f..ecca4eb0d6 100644
--- a/parquet/src/main/java/org/apache/iceberg/parquet/ParquetIO.java
+++ b/parquet/src/main/java/org/apache/iceberg/parquet/ParquetIO.java
@@ -18,7 +18,6 @@
*/
package org.apache.iceberg.parquet;
-import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -187,18 +186,10 @@ class ParquetIO {
parquetFileRange -> {
CompletableFuture<ByteBuffer> future = new
CompletableFuture<>();
parquetFileRange.setDataReadFuture(future);
- try {
- return new FileRange(
- parquetFileRange.getDataReadFuture(),
- parquetFileRange.getOffset(),
- parquetFileRange.getLength());
- } catch (EOFException e) {
- throw new RuntimeIOException(
- e,
- "Failed to create range file for offset: %s and length:
%s",
- parquetFileRange.getOffset(),
- parquetFileRange.getLength());
- }
+ return new FileRange(
+ parquetFileRange.getDataReadFuture(),
+ parquetFileRange.getOffset(),
+ parquetFileRange.getLength());
})
.collect(Collectors.toList());
}