Skip to main content

Module data

Module data 

Source
Expand description

The data steps: array and text operations that need no model — map, filter, reduce, sort, dedupe, chunk, parse — as pure functions over JSON values. Element expressions are CEL (item, index, acc, plus the run data) or {{template}} strings; by keys are dotted paths. Being pure and model-free, these steps cost nothing to replay, so the runtime may re-run them after a crash instead of checkpointing each one.

Functions§

chunk
chunk: split text by chars|lines|tokens (approximate) or an array into slices of size, with overlap elements/chars carried over.
cmp_values
A total order over JSON values: null < bool < number < string < array < object.
dedupe
dedupe: keep the first occurrence per key (by path) / value.
filter
filter: keep the elements whose expr is true.
map
map: expr over every element.
parse
parse: text → JSON (json | yaml | csv | lines | auto).
path_of
A dotted path inside a value.
reduce
reduce: fold expr over the elements with acc (starting at initial).
sort
sort: by a dotted path (or the element itself), asc|desc; stable.