Repository navigation
[python] Support positional reads for small Jindo ranges - #10817
Merged
JingsongLi merged 1 commit intoOct 27, 2026
Merged
Conversation
plusplusjiajia
marked this pull request as draft
October 26, 2026 14:51
plusplusjiajia
force-pushed
the
python-jindo-pread-random-access
branch
3 times, most recently
from
October 26, 2026 15:21
7f3b46b to
78f1778
Compare
PyArrow implements PythonFile.read_at as seek + read on the wrapped file, so JindoInputFile.read_at is never reached and every Parquet column chunk and manifest range goes through Jindo's sequential stream, which reads ahead a whole buffer. Against OSS, 40 reads of 12 KB transferred 58 MB, and projecting 3 of 22 columns read 33% more bytes than PyArrow S3. Add fs.oss.jindo.pread-max-size, disabled by default. When set, a read of at most that size after a backward seek, a forward seek of more than 1 MiB, or as the first read away from the start fetches exactly its range with pread. Other reads keep the stream, so sequential and dense reads still use read-ahead and large ranges keep Jindo's parallel download. A value in the REST data token overrides the catalog option. With the default, reads behave as before.
plusplusjiajia
force-pushed
the
python-jindo-pread-random-access
branch
from
October 26, 2026 15:23
78f1778 to
79934da
Compare
plusplusjiajia
marked this pull request as ready for review
October 27, 2026 00:06
Contributor
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
PyArrow implements
PythonFile.read_at(nbytes, offset)asseek(offset)plusread(nbytes)on the wrapped file object, soJindoInputFile.read_at, which calls Jindo'spread, is never reached. Every Parquet column chunk and manifest range read goes through Jindo's sequential stream, which reads ahead a whole buffer. Against OSS, 40 positional reads of 12 KB transferred 58 MB, and reading 3 of 22 columns transferred 33% more than PyArrow S3.This PR adds
fs.oss.jindo.pread-max-size, disabled by default. When it is set,JindoInputFiletracks its own position. A read of at most that size usespreadif it follows a backward seek or a forward seek of more than 1 MiB, or if it is the first read on the file and not at the stream position.All other reads keep the stream. Contiguous reads and short forward skips are served by Jindo's read-ahead, and reads above the threshold keep Jindo's parallel download. With the default,
read,seekandtelltake the existing code path.As with other options, a value in the REST data token overrides the catalog option, so a REST server can enable it per table.
Measured on Alibaba Cloud OSS with pyjindosdk 6.10.4. Bytes come from the OSS access logs; times include catalog and planning work and vary between runs:
4mbTests
pypaimon/tests/jindo_file_system_test.py:pread;pread;SEEK_CURworks;PythonFile.read_atreachespread;jindo_file_system_test.py,video_format_test.py,caching_file_io_test.pyandrest/rest_token_file_io_test.pypass (141 passed).