RussellSpitzer commented on code in PR #17284:
URL: https://github.com/apache/iceberg/pull/17284#discussion_r3895839000
##########
core/src/main/java/org/apache/iceberg/io/EagerInputFile.java:
##########
@@ -60,12 +72,44 @@ 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);
+ // reads from the already open stream; no additional request
+ if (src.read() != -1) {
+ throw new IOException("Did not reach the end of stream after reading "
+ length + " bytes");
Review Comment:
nit on this, the exception is not clear why this is an issue. "Incorrect
length provided for file %x, given a length of %d and did not reach the end of
stream."
--
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]