apache / apache/arrow

[C++] Deprecate `RandomAccessFile::Read{At,Async}` without `allow_short_read`

Open
#49,904 1 comment 0 reactions 1 assignee Claimed by @UdayanMahalwar View on GitHub
Component: C++ good-second-issue Type: enhancement
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the enhancement requested

In PR https://github.com/apache/arrow/pull/49897 we introduced overloads of `RandomAccessFile::ReadAt` and `RandomAccessFile::ReadAsync` with an additional `bool allow_short_read` argument. This ensures that the caller is conscious about the potential return value of these methods when the file is not large enough to satisfy the entire read.

The legacy `RandomAccessFile::ReadAt` and `RandomAccessFile::ReadAsync` methods without the new argument are slightly dangerous as the caller then has to check the length of the returned result. We should deprecate them and schedule them for removal in a bunch of versions (perhaps in 4 versions to give some time for callers to migrate their API usage?).

### Component(s)

C++

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.