Data FlowData Flow
DataFlow
  • User Manual
  • Developer Manual
  • Examples
  • API Reference
Overview
Getting Started
Pipeline Authoring
    Pipeline Spec OverviewConnections
    Sources
    Transforms
      TransformsTransform step: filterTransform step: selectTransform step: renameTransform step: castTransform step: deriveTransform step: aggregateTransform step: add_timestampTransform step: forward_fillTransform step: gap_fill
    Destinations
    Execution Settings
Execution
Deployment
Troubleshooting
Examples
Transforms

Transforms

Transforms change rows. Each transform reads from a build (or another transform via SQL) and either applies a list of steps in order, or runs a single SQL query - never both.

Each step receives the frame produced by the one before it, in the order you list them. A SQL transform replaces from + steps with a single query.

At a glance

  • Steps or SQL, never both - list steps in order, or give a single query.
  • Row-wise and stateful steps - filter, select, rename, cast, derive, add_timestamp, plus aggregate, forward_fill, gap_fill.
  • State is safe - stateful results commit only after every destination succeeds.

Common shape

Code
transforms: - name: enrich_orders from: builds.base_orders # or a SQL query instead of from+steps steps: - type: filter filter_expr: "amount > 100" - type: derive columns: - name: total_price expr: "amount * 1.16"

Step types

Row-wise steps

StepPurposeKey fields
filterKeep matching rowsfilter_expr
selectKeep a set of columnscolumns
renameRename columnscolumns (from/to)
castChange column typescolumns (name/type)
deriveNew columns from SQL expressionscolumns (name/expr)
add_timestampAdd ingestion timestampscolumns (default ingested_at)

Ordered and stateful steps

StepPurposeKey fields
aggregateGroup-by aggregationscolumns, group_by
forward_fillCarry last value forwardorder_by, partition_by, columns
gap_fillGenerate missing rowssequence

aggregate, forward_fill, and gap_fill can keep state across runs - see Stateful transforms.

Reference by step

Every field, type, default, and required marker is listed per step:

StepReference
filterfilter
selectselect
renamerename
castcast
derivederive
add_timestampadd_timestamp
aggregateaggregate
forward_fillforward_fill
gap_fillgap_fill

Steps in detail

filter

Any Spark SQL expression; simple column op value comparisons are auto-normalized:

Code
- type: filter filter_expr: "amount > 100"

select, rename, cast, derive

Code
steps: - type: select columns: [{ name: order_id }, { name: amount }] - type: rename columns: [{ from: order_date, to: date }] - type: cast columns: - { name: amount, type: double } - { name: ts, type: timestamp } - type: derive columns: - name: total_price expr: "amount * 1.16"

derive accepts any Spark SQL expression (amount * qty, upper(name), concat(a, '-', b), CASE expressions, …).

add_timestamp

Adds current_timestamp() columns - defaults to a single ingested_at column when columns is empty.

aggregate

Code
- type: aggregate group_by: [customer_id, country] columns: - name: total_amount expr: "sum(amount)" - name: avg_amount expr: "avg(amount)"

Grammar: any Spark SQL aggregate works for plain batch and windowed streaming aggregates (sum(price*qty), stddev, collect_set, …). With managed state (below) or streaming running totals, only single-function primitives are allowed - sum(col), avg(col), count(col), count(*), min(col), max(col). Precompute compound expressions with derive first.

forward_fill

Fills nulls with the last non-null value per partition and order:

Code
- type: forward_fill partition_by: [well_id] order_by: [ts] columns: [{ name: pressure }, { name: temperature }]

Optional per-column default values, and a history block (from, column, order_by, partition_by) to source history from another frame. Adds __ff_{name}_original_value and __ff_{name}_forward_filled helper columns.

gap_fill

Generates the missing rows in a sequence:

Code
- type: gap_fill order_by: [ts] sequence: column: ts type: datetime step_size: "15 minute" start_value: "2026-01-01 00:00:00" end_value: "now" # or a literal fill_strategy: forward # or null (default)

Sequence types: integer (step_size, start_value/end_value or min/max), date, datetime (interval step_size, end_value: now = watermark), or string (expected_values list). Adds __gf_flag (true on generated rows) and __gf_forward_filled_from columns.

SQL transforms

Instead of from + steps, a transform can be one SQL query:

Code
transforms: - name: big_orders query: | SELECT customer_id, count(*) AS orders, sum(amount) AS total FROM builds.orders WHERE amount > 100 GROUP BY customer_id

Tables are referenced by FQN. In a transform query the available frames are builds.* and any earlier transforms.* - sources are consumed by the build stage, so read them in a build. Plain SELECT, SELECT + JOINs, and set operations (UNION / UNION ALL / INTERSECT / EXCEPT) are supported - no CTEs. Unknown table references list the available frames in the error.

Stateful transforms

aggregate, forward_fill, and gap_fill can keep state across runs so results accumulate:

Code
- type: aggregate group_by: [customer_id] columns: - name: lifetime_value expr: "sum(amount)" state: enabled: true # default late_arrival: # optional watermark grace column: ts max_latency: 10 minutes window: # streaming + aggregate only type: tumbling # or session duration: 5 minutes # tumbling idle_timeout: 10 minutes # session

Where state lives depends on the mode:

ModeState storage
batchParquet state files per step, committed after all destinations succeed
streamSpark checkpointed state (with the stream checkpoints)

In batch mode, state is written atomically after destinations succeed and discarded entirely if the run fails - a failed run leaves state exactly as it was. With window set, streaming aggregates become windowed (tumbling/session) group-bys; without it they are running totals. state.enabled: true on a non-stateful step type is a validation error.

Related pages

  • Pipeline Spec Overview - the full spec model
  • Sources - the frames transforms read from
  • Destinations - write the results
  • Checkpoints and Offsets - offsets vs state vs checkpoints
Suggest edit
Last modified on November 26, 2026
Stream SourcesTransform step: filter
On this page
  • At a glance
  • Common shape
  • Step types
    • Row-wise steps
    • Ordered and stateful steps
  • Reference by step
  • Steps in detail
    • filter
    • select, rename, cast, derive
    • add_timestamp
    • aggregate
    • forward_fill
    • gap_fill
  • SQL transforms
  • Stateful transforms
  • Related pages
YAML
YAML
YAML
YAML
YAML
YAML
YAML
YAML