Templates¶
A template is a YAML file under templates/ that declares a list of
parametrised actions. A flowgroup invokes it with use_template: and supplies
template_parameters:; LHP renders the {{ param }} placeholders with those
values and expands the template into the flowgroup’s actions.
name: <template_name>
version: "1.0"
presets: []
parameters:
- name: <param_name>
required: <bool>
default: <value>
actions:
- name: "<action_{{ param_name }}>"
type: <load|transform|write|test>
...
See also
How-to guide: Parameterize a template for many tables.
Template file fields¶
Top-level fields of a template file. Only name is required; every other
field has a default.
Field |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
— |
Template identifier, surfaced in validation errors. |
|
string |
No |
|
Version tag for change tracking. |
|
string |
No |
— |
Human-readable summary of the template. |
|
list[string] |
No |
|
Preset names applied to the actions this template generates. |
|
list[mapping] |
No |
|
Parameter declarations (entry schema below). |
|
list[mapping] |
No |
|
Action patterns carrying |
Parameter fields¶
Keys of a single entry in the parameters: list. The engine reads only
name, required, and default.
Key |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
— |
Parameter name. Referenced as |
|
bool |
No |
|
When |
|
any |
No |
— |
Value used when the flowgroup omits the parameter. |
|
string |
No |
— |
Human-readable note. Not read by the engine. |
Invoke from a flowgroup¶
A flowgroup expands a template through these two fields.
Field |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
No |
— |
File name (stem, without |
|
mapping |
No |
— |
Values supplied to the template’s parameters, keyed by parameter name. Merged over declared defaults. |
name: csv_to_bronze
version: "1.0"
parameters:
- name: table_name
required: true
- name: file_format
default: csv
actions:
- name: "load_{{ table_name }}"
type: load
readMode: stream
source:
type: cloudfiles
path: "${landing_volume}/{{ table_name }}/*.{{ file_format }}"
format: "{{ file_format }}"
target: "v_{{ table_name }}_raw"
pipeline: bronze
flowgroup: customer_ingestion
use_template: csv_to_bronze
template_parameters:
table_name: customer
file_format: csv