name: op-synth-constant
description: Emit a constant value on every row; useful for unit testing, sentinel columns, and placeholder fields.
kind: operator
category: SYNTH
operator: constant
type: reference
applies_to: inspect, predict, manifest
examples_tags: [synth, data-quality]
Synth distributions emit per-row values; no Response.Components.
Use when
Puts the same value on every row, for a placeholder field or a fixed flag in a test fixture.
Questions it answers:
- How do I fill a column with the same country code?
- How do I add a fixed version field to test data?
Use something else:
monotonic_fromwhen each row needs a distinct ID.weighted_categoricalwhen the value should vary over a few labels.bernoulliwhen a flag should be set on only some rows.
Params
value— any, required. Per-row payload. Interpreted by the declared field type at write time.
value is checked and normalised to the field’s row shape once, at spec parse — never at write time.
Inputs
field type: — any .pulse field type. Categorical takes a string, set_* a list of option names, numeric/date a number or bool (decimal128 also a string).
Output
Same value returned on every row. RNG state untouched.
Gotchas
- Missing
valueparam →SERVICE_VALIDATION(“requires param value”). - A
valuethe field cannot hold (text on a number field) →SERVICE_VALIDATIONat spec parse. - Consumes NO RNG — like
monotonic_from, adding / removing a constant field preserves byte-equality of every other field’s stream. - A constant categorical still emits a one-entry dictionary block (one byte per row at
categorical_u8); for a packed-bool equivalent usebernoulliwithp=0/p=1.
See
pulse_examples_search tags=[synth]- Skills:
synthetic-data,op-synth-monotonic-from,op-synth-bernoulli