Different pipes. One standard.

Type to search this site.

Search runs in your browser against a static index built with this site (Pagefind). Nothing you type is sent to a server.

Ports — so a step says what it takes and gives

Wiring two outputs and a reject stream needs a framework. Unix pipes stop at one stdin and one stdout.

The problem #

A Unix pipe has exactly one way in and one way out. The moment a step needs a second input (a lookup table) or a second output (the records it rejected), you are writing temporary files and conventions.

The fix #

A step names each way in and each way out. Those names are its ports.

yaml
inputs:
  email: {schema: {format: json-schema, definition: {type: string}}}
outputs:
  email: {schema: {format: json-schema, definition: {type: string}}}
  rejected: {required: false}

Now “the rejected output of the mask step” is something a pipeline can point at: mask.outputs.rejected.

The precise terms #

  • A port has a kind: records (the default), values, batches, windows, text or binary.
  • A port may have a schema (JSON Schema by default, Arrow for typed batches) describing one item. A port without a schema is untyped.
  • Ports are required by default. An optional output that nothing reads is simply switched off, and the step is told so before it starts.
  • A step with no inputs is a source; with no outputs, a sink; otherwise a pipe.

Normative text: Pipe specification