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,textorbinary. - 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.