varun-lakhyani commented on code in PR #17284:
URL: https://github.com/apache/iceberg/pull/17284#discussion_r3885430939


##########
core/src/main/java/org/apache/iceberg/io/EagerInputFile.java:
##########
@@ -60,12 +72,40 @@ public boolean exists() {
 
   @Override
   public SeekableInputStream newStream() {
-    byte[] bytes = new byte[(int) fileSize];
+    byte[] bytes = new byte[(int) length];
     try (SeekableInputStream src = delegate.newStream()) {
       IOUtil.readFully(src, bytes, 0, bytes.length);

Review Comment:
   Done 
https://github.com/apache/iceberg/pull/17284/commits/b700403822482dbdaec1773aa3080b08cd82eea4,
 
   smaller than the recorded length already throws from IOUtil.readFully. Eager 
now also throws when the file is larger by reading one additional byte that 
must be -1. No new request — it's served from the already open stream.
   It also adds a small unit test @kevinjqliu 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to