You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Goal: Replace the stub with a self-contained single-field DISTINCT query. This phase both builds and executes, returning AsyncIterable<Value> directly — no descriptor, no ContentItem, no base join shape.
Work
Build: from the PropertyField/CalculatedField, build a minimal FROM + just the JOINs needed to reach that one field's class (from its pathFromTarget), per target. Apply the target filter and value filters (reuse the shared target-filter helper extracted in content: Shared base-query builder (FROM / JOIN / WHERE) #1409). SELECT DISTINCT the field's column ($->[Prop] for property fields, the expression for calculated).
Execute: for multi-target, run one query per target and merge their streams (rxjs mergeMap, mirroring ResolveContentSources.ts); de-duplicate across targets when the same raw value appears for more than one. Use createQueryReader(query, { rowFormat: "Indexes" }) with finalize(() => reader.return?.()) for cancellation, consistent with Stage 1.
Yield raw Values as an AsyncIterable (no formatting — formatting/grouping is the consumer's job). The optional reduce-style grouping utility (formatter → Map<formatted, raw[]>) noted in the design can land here if not already present.
Tests: distinct over direct + related field; filter application; multi-target merge + cross-target de-dup; raw (unformatted) output; reader cancellation frees resources.
Dependencies: shared target-filter helper from #1409.
Goal: Replace the stub with a self-contained single-field DISTINCT query. This phase both builds and executes, returning
AsyncIterable<Value>directly — no descriptor, noContentItem, no base join shape.Work
PropertyField/CalculatedField, build a minimal FROM + just the JOINs needed to reach that one field's class (from itspathFromTarget), per target. Apply the target filter and valuefilters(reuse the shared target-filter helper extracted incontent: Shared base-query builder (FROM / JOIN / WHERE) #1409).SELECT DISTINCTthe field's column ($->[Prop]for property fields, the expression for calculated).mergeMap, mirroringResolveContentSources.ts); de-duplicate across targets when the same raw value appears for more than one. UsecreateQueryReader(query, { rowFormat: "Indexes" })withfinalize(() => reader.return?.())for cancellation, consistent with Stage 1.Values as anAsyncIterable(no formatting — formatting/grouping is the consumer's job). The optionalreduce-style grouping utility (formatter →Map<formatted, raw[]>) noted in the design can land here if not already present.Tests: distinct over direct + related field; filter application; multi-target merge + cross-target de-dup; raw (unformatted) output; reader cancellation frees resources.
Dependencies: shared target-filter helper from #1409.