ek9_query_pipeline
Answers first: status, stageCount, then stages[] in order {operator, kind, consumes, produces}, sourceType, resultType and summary.transformations.
When to use it
'What does each stage of this stream pipeline consume and produce' is one call with symbol:'Type.method' (its first pipeline) or file+line on any line of it.
When not to use it
- an imperative body with branches, loops or guards, not a stream chain (use
ek9_query_flow) - method-level caller/callee relationships, not stage-level pipeline analysis (use
ek9_query_call_graph) - the structural outline of a class/record, not pipeline details (use
ek9_query_construct) - compile errors/warnings (incl. pipeline type mismatches), not the pipeline structure (use
ek9_query_diagnostics)
Details
stages[] is ordered, each carrying operator, kind, context, consumes, produces (consumes omitted on source stages). kind enum: source (cat/for), filter (filter/reject/uniq), map (map/flatten/group/join/split), limit (head/tail/skipping), sort, tee, async, call, reduce, terminal (collect/`>`/`>>`), with kind-specific arg fields predicate/function/limit/collector (limit numeric for a plain int literal, else raw text). Flat sourceType/resultType and nested summary{stageCount, sourceType, terminalType, transformations[]} give the whole-pipeline type-evolution story. Where pipelines nest, the innermost chain spanning the line wins; a body holding several pipelines needs file+line for any but the first.
Arguments
| Argument | Type | Required | What it is |
|---|---|---|---|
file | string | The EK9 source file - OPTIONAL when symbol is a construct name; required to anchor on a member or a use site. | |
line | integer | 1-based line the pipeline spans - any line of the chain; OMIT it and pass symbol:'Type.method' for the first pipeline in that body, or use ek9_read_file(lineNumbers:true) rather than counting. | |
symbol | string | The method or function whose body holds the pipeline - 'Type.method' or a function name - no file or line needed; the FIRST pipeline in that body is decomposed. |
Recorded calls
Real calls, recorded against small projects and checked on every build - a changed answer fails it.
Pipeline shape
Request
{
"file" : "Hello.ek9",
"line" : 6
}
Response
{
"meta" : {
"serverMs" : "<timing>"
},
"nextStep" : "anchor on a line of the cat | ... | collect chain, or pass symbol:'Type.method' for the first pipeline in that body",
"note" : "No stream pipeline found at line 6",
"status" : "not-found"
}
See also
- Show me in the IDE: Chapter 12: a pipeline, built