feat(sources): B2.2 — keyset merge-join - #73
Merged
Conversation
The second multi-source strategy. Join.MergeJoin merges two sources ordered by the same key into an IStreamingSource<TResult>: for each left row it emits the contiguous group of right rows sharing its key. Inner drops unmatched left rows; LeftOuter keeps them with an empty group. Streams the merge (one right key-group buffered at a time) so memory is constant when per-key multiplicity is bounded; the pipeline slices the stream into batches. - DelegatingStreamingSource<TResult> (thin IStreamingSource over a produce delegate) keeps the class type params low; the four-type ergonomic API lives on Join.MergeJoin, where S2436 is suppressed with a justification (a join needs 4 types, like BCL GroupJoin). - An internal Paginate<T> reads a batch source page by page as a flat async sequence. Tests (4 green Join total): inner emits only matched left rows with their group (right rows spanning a page boundary, in order); left-outer keeps unmatched left rows with an empty group. PLAN B2.2 done.
…S3776/CA1859/IDE0008)
|
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.



The second multi-source strategy — the keyset merge-join.
Join.MergeJoinmerges two sources ordered by the same key into anIStreamingSource<TResult>. For each left row it emits the contiguous group of right rows sharing its key. Inner drops unmatched left rows; LeftOuter keeps them with an empty group.Design
DelegatingStreamingSource<TResult>keeps the class type params low; the four-type ergonomic API lives onJoin.MergeJoin(S2436 suppressed with a justification — a join needs 4 types, exactly like BCLEnumerable.GroupJoin).Paginate<T>reads a batch source page by page as a flat async sequence.Tests (4 green Join total)
Epic B2 status
B2.1 (enrichment) ✅ + B2.2 (merge-join) ✅ — both strategies done. Remaining: B2.3 (packaging + sample, needs your Pro-vs-free call) and B2.4 (dynamic config, optional).