Parameter Syntax

Parameters use $name syntax in pipeline SQL. Declared via DEFAULTS clause, overridable at trigger time via API.

Category: schedule-defaults

Syntax

DEFAULTS ($batch_date = '2024-01-01')
-- Then use: SELECT * FROM t WHERE date = $batch_date

Description

This reference topic explains the parameter declaration and substitution syntax used in pipeline SQL files. Parameters are declared in the `DEFAULTS` clause of a `PIPELINE` block using the format `DEFAULTS ($name = 'value', $name2 = 1000, ...)`, where each parameter name is prefixed with `$` and assigned a literal default value that can be a quoted string or a numeric literal. Within the SQL statements that follow the pipeline declaration, any occurrence of `$name` is replaced with the parameter's resolved value at execution time. For example, `DEFAULTS ($batch_date = '2024-01-01', $limit = 500)` makes both `$batch_date` and `$limit` available in subsequent queries such as `SELECT * FROM orders WHERE order_date = $batch_date LIMIT $limit`. Default values can be overridden at trigger time by passing a parameter map to the control plane API (`POST /pipelines/{id}/trigger` with a `parameters` body), allowing the same pipeline definition to serve multiple environments or date ranges without modification.

Open in interactive docs →   DeltaForge home →