Repository navigation
GH-48111: [C++][Dataset] Avoid hang when fragment_readahead is 0 - #55297
Open
555aaditya wants to merge 1 commit into
Open
555aaditya wants to merge 1 commit into
555aaditya wants to merge 1 commit into
Conversation
Unordered scans called MakeMergedGenerator with fragment_readahead, which never subscribes to any fragment when it is 0. Use the concatenated generator for fragment_readahead <= 1 on both the sequenced and unsequenced paths, as apacheGH-15264 already did for the sequenced one.
|
|
Author
|
For context: #51543 tried to fix this earlier and was closed. This PR takes a slightly different route. Instead of keeping the merged generator and forcing it to one subscription, it uses the concatenated generator for |
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.
Rationale for this change
dataset.scanner(fragment_readahead=0).to_table()never returns.GH-15264 (#29185) made the scan node read fragments with a concatenated generator when
fragment_readaheadis 0 or 1. That change only coveredrequire_sequenced_output. The unsequenced path, whichToTableandScanBatchesUnordereduse, still callsMakeMergedGenerator(..., fragment_readahead). With 0, the merged generator never subscribes to a fragment, so the scan waits forever.ScannerBuilder::FragmentReadaheadaccepts 0, so 0 is a valid value.What changes are included in this PR?
MakeScanNodenow uses the concatenated generator forfragment_readahead <= 1on both paths. Forfragment_readahead > 1nothing changes.Are these changes tested?
Yes.
TestScanner.ScanWithoutFragmentReadahead. It runs ordered and unordered scans withfragment_readahead0 and 1. Without the fix it hangs on the first case. With the fix all 4 parameterizations pass.test_scanner_no_fragment_readaheadintest_dataset.py, which reproduces the snippet from the issue.ctest -R "arrow-dataset|arrow-acero"passes locally (26 tests, macOS arm64, debug build).Are there any user-facing changes?
Scans with
fragment_readahead=0no longer hang.Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
Reviewed before submission by: