The problem #
Hand-wired steps either load everything into memory or pass data through unbounded queues. Both work on the sample file and fall over on the real one.
The fix #
What travels between two ports is a stream: an ordered sequence of items. By default it is one JSON value per line.
json
{"value":10}
{"value":20}
{"value":30}The buffer between two steps is bounded. When it is full the producer waits. Nothing is dropped, and memory stays flat however large the input is.
The precise terms #
- The default encoding is NDJSON (
application/x-ndjson): UTF-8, one JSON value per line, a final newline, no blank lines. A string value is a JSON string line:"a@b.c". - Numbers pass through unchanged, digit for digit, so large integers and decimals survive.
- A waiting producer is backpressure. With two consumers of one output (a broadcast), the slowest sets the pace.
- Order is preserved per stream. Only conversions that lose nothing are inserted automatically, and they are listed in the execution plan.
- When a step fails, the run fails fast and says so. Output already written is not rolled back; the final status reports
partialOutput: true. - A window is a meaningful group of records with a boundary. A batch is only a transport unit. They are never confused.
- Batch mode — a declared
batch: {maxItems, maxWaitMs}— lets the runner hand a subprocess or Starlark pipe several records at a time. It is experimental and in v0.0.1: see Batch mode.