[python] Support read.parallelism=auto for single-process reads#8637
Open
TheR1sing3un wants to merge 1 commit into
Open
[python] Support read.parallelism=auto for single-process reads#8637TheR1sing3un wants to merge 1 commit into
TheR1sing3un wants to merge 1 commit into
Conversation
read.parallelism defaulted to 1 (serial), the bottleneck for multi-split to_arrow/to_pandas/to_duckdb reads done directly through pypaimon. Add an opt-in "auto" value that resolves to min(number of splits, CPU count), accepted both as the read.parallelism option and as the runtime parallelism argument. The global default stays 1 so distributed engines (Ray/Daft), which already parallelize across splits at the outer layer, do not double-parallelize. READ_PARALLELISM becomes a string option to carry "auto"; on-disk table options are already stored as strings, so existing int values keep working and cross-engine schemas are unaffected.
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
read.parallelismdefaulted to 1 (serial), the bottleneck for multi-splitto_arrow/to_pandas/to_duckdbreads done directly through pypaimon.This adds an opt-in
"auto"value that resolves tomin(number of splits, CPU count), accepted both as theread.parallelismoption and as the runtimeparallelismargument. The global default stays 1 so distributed engines (Ray/Daft), which already parallelize across splits at the outer layer, do not double-parallelize.READ_PARALLELISMbecomes a string option to carry"auto"; on-disk table options are already stored as strings, so existing int values keep working and cross-engine schemas are unaffected.Tests
New unit tests for parallelism parsing (
auto, integer strings, invalid values, case/whitespace) plus end-to-endauto-vs-serial parity tests via both the runtime argument and the table option inreader_parallel_test.py.