Skip to content

Conversation

@SanjayMarreddi
Copy link
Contributor

@SanjayMarreddi SanjayMarreddi commented Jun 20, 2025

Description of change

We want to support readFully as a part of our ongoing effort to integrate with Iceberg S3FileIO by default. RangeReadable in Iceberg

Note: Here's the comparison with existing read method:

Aspect read(byte[] buffer, int offset, int length) readFully(long position, byte[] buffer, int offset, int length)
Method Signature Reads from current stream position Reads from specified position
Position Behavior Advances the stream position by the number of bytes actually read Does not modify the stream position (position-independent read)
Return & Error Handling Returns int indicating bytes read; returns -1 at end of stream; may return fewer bytes than requested Returns void; throws IOException if unable to read exact number of requested bytes

Relevant issues

Once this feature is released as 1.2.0, we will update this Iceberg PR

Does this contribution introduce any breaking changes to the existing APIs or behaviors?

No

Does this contribution introduce any new public APIs or behaviors?

Yes

How was the contribution tested?

Ran existing and new tests locally

Does this contribution need a changelog entry?

  • I have updated the CHANGELOG or README if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).

stubz151
stubz151 previously approved these changes Jun 23, 2025
Copy link
Contributor

@rajdchak rajdchak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, let's reuse the read methods we already have.

Copy link
Contributor

@rajdchak rajdchak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @SanjayMarreddi looks good to me!

@SanjayMarreddi SanjayMarreddi merged commit 4f1a897 into awslabs:main Jun 25, 2025
3 of 4 checks passed
ozkoca pushed a commit that referenced this pull request Jun 26, 2025
## Description of change
We want to support `readFully` as a part of our ongoing effort to
integrate with Iceberg S3FileIO by default. [RangeReadable in
Iceberg](https://github.com/apache/iceberg/blob/main/api/src/main/java/org/apache/iceberg/io/RangeReadable.java#L47)

**Note:** Here's the comparison with existing read method:

| Aspect | `read(byte[] buffer, int offset, int length)` |
`readFully(long position, byte[] buffer, int offset, int length)` |

|--------|----------------------------------------------|-------------------------------------------------------------------|
| Method Signature | Reads from current stream position | Reads from
specified position |
| Position Behavior | Advances the stream position by the number of
bytes actually read | Does not modify the stream position
(position-independent read) |
| Return & Error Handling | Returns `int` indicating bytes read; returns
-1 at end of stream; may return fewer bytes than requested | Returns
`void`; throws `IOException` if unable to read exact number of requested
bytes |

#### Relevant issues
Once this feature is released as `1.2.0`, we will update this [Iceberg
PR](apache/iceberg#13361)

#### Does this contribution introduce any breaking changes to the
existing APIs or behaviors?
No

#### Does this contribution introduce any new public APIs or behaviors?
Yes

#### How was the contribution tested?
Ran existing and new tests locally

#### Does this contribution need a changelog entry?
- [x] I have updated the CHANGELOG or README if appropriate

---

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and I agree to the terms of
the [Developer Certificate of Origin
(DCO)](https://developercertificate.org/).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants