Skip to main content
A promotion transforms parsed data and writes it to a target table. A spec can have several promotions (one per output dataset), and each runs an ordered list of steps.

Promotion shape

Write behavior

Promotions write with one of three modes — merge (upsert on merge_keys), append (insert only), or overwrite partition (replace a partition). In practice, a promotion with merge_keys upserts on those keys; update_columns narrows which columns are written on a match (e.g. only enrich postal_code without touching the rest of the row).

Ordering

Steps run top to bottom. Each step sees the output of the previous one, so order matters — e.g. add/rename columns before generate_id, and run an id_mapping_output only after the id exists.

Step catalog

Every step is an object with a type. Below, grouped by purpose.

Shaping

Casts each listed column to the given Spark SQL type.
condition is a SQL WHERE expression (without the WHERE keyword).
strategy: drop (default), keep_first, or keep_last. order_by / order_desc decide which row survives for keep_first/keep_last.
expression is any SQL scalar expression (literals, functions, CASE, references to other columns).
Maps source → target names.
Drops everything not listed.
Writes a value from the runtime context (e.g. organization_id, created_by) as a literal column.

Joining

join_type: left (default), inner, outer, right. select_columns picks (and optionally aliases) columns from the joined dataset.
Adds two capabilities over join: a fallback_join_column (COALESCE-style secondary key) and select_expressions (custom SQL expressions selected from the target).
Aggregates the target with functionavg, max, min, sum, count, first, then joins the result on join_column.

Reshaping

Turns { id, col1, col2, … } into { id, variable, value } rows. variable_column/value_column default to variable/value.

Identity & taxonomy

Derives a deterministic id from key_columns — the same key values produce the same id across runs (idempotent), which is what makes re-ingestion safe. An optional namespace scopes the derivation (UUID v5). Defaults: output_column = id, key_columns = all non-null columns.
Persists a mapping of code_column → id_column under mapping_type, so later promotions (in this or another spec) can resolve foreign keys against it.
Looks source_column up in the mapping created by an earlier id_mapping_output and writes the resolved id into output_column.
Resolves a text label (e.g. a size or color) to a Solya taxonomy id. source_id_column optionally provides the POS reference for disambiguation.

Sub-option reference

Cross-spec foreign keys work via the id_mapping_outputid_mapping_join pair: one promotion publishes the mapping, later promotions consume it. See worked examples.