feat(sources): B2.1 — enrichment source (batched per-page lookup) - #72
Merged
Conversation
First step of Epic B2 (multi-source). A primary source can be enriched with data looked up from a secondary, once per page. - New package NeoReports.Sources.Join (IsPackable=false; packaging/license are the open B2 decision D29, settled in B2.3). EnrichingBatchSource<TPrimary,TKey,TLookup,TResult> wraps a primary IBatchSource: per page it collects distinct keys, makes ONE batched lookup call, and maps each row with its value (missing -> default). O(pageSize), no N+1. Fluent entry .Enrich(key, lookup, map). It is a standard IBatchSource<TResult>, so the existing pipeline (batch/retry/writer/destination) consumes it unchanged. Tests (2 green): one batched call per page with that page's distinct keys; missing keys map to the default lookup value. PLAN B2.1 done.
…(S2436/CodeQL) - The class now takes a page-transform delegate (2 type params, clears S2436). The four-type ergonomic API stays on the Enrich extension, where S2436 is suppressed with a justification (a batched join needs 4 types, like BCL Enumerable.GroupJoin). - Build the enriched page with Select/Distinct (CodeQL use-Select). No behavior change; 2 green.
|
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.



First step of Epic B2 (multi-source) — the enrichment strategy.
A primary source is enriched with data looked up from a secondary, once per page:
Changes
NeoReports.Sources.Join—EnrichingBatchSource<TPrimary,TKey,TLookup,TResult>: per page it collects the distinct keys, makes one batchedlookupcall (never one per row), and maps each row with its value (missing → default). O(pageSize), structurally no N+1. Fluent entry.Enrich(key, lookup, map).IBatchSource<TResult>, so the existing pipeline consumes it unchanged.IsPackable=false— packaging & license (Pro vs free) are the open B2 decision (D29), settled in B2.3; not auto-published yet.Tests (2 green)
Next
B2.2 — the keyset merge-join (streaming, two same-key-ordered sources, inner + left-outer).
Still pending from you (before B2.3 packaging): Pro vs free for the join package (I recommend Pro), join types, dynamic-config, validation gate — see
docs/epic-b2-multisource.md.