Operational metadata¶
Operational metadata columns are Spark expressions appended to generated
tables as extra columns. Define them under the optional operational_metadata
key in lhp.yaml, then add them to a flowgroup or action with the
operational_metadata selection field:
operational_metadata:
columns:
<name>:
expression: <spark_expression>
presets:
<group_name>:
columns: [<name>, ...]
See also
Concept: How Lakehouse Plumber works.
Project block¶
Top-level keys under operational_metadata in lhp.yaml.
Field |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
mapping |
Yes |
— |
Named metadata columns ( |
|
mapping |
No |
— |
Named column groups ( |
Column definition¶
Each entry under columns.<name>. A bare string value is shorthand for
expression.
Field |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
— |
Spark expression evaluated per row (e.g. |
|
string |
No |
— |
Free-text description of the column. |
|
list[string] |
No |
|
Target types the column is emitted for. Values: |
|
list[string] |
No |
— |
Extra import statements the expression needs (e.g. |
|
bool |
No |
|
Whether the column is active. |
Preset definition¶
Each entry under presets.<name> names a group of columns. A bare list
value is shorthand for columns.
Field |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
list[string] |
Yes |
— |
Column names in the group. Each must be defined under |
|
string |
No |
— |
Free-text description of the group. |
Built-in columns¶
Available only when the project defines no operational_metadata.columns.
Defining any project column replaces this set.
Name |
Expression |
Applies to |
Description |
|---|---|---|---|
|
|
view, streaming_table, materialized_view |
When the record was ingested. |
|
|
view |
Source file path. |
|
|
view, streaming_table, materialized_view |
Pipeline run identifier. |
|
|
view, streaming_table, materialized_view |
Pipeline name. |
|
|
view, streaming_table, materialized_view |
FlowGroup name. |
Selection field¶
The operational_metadata field on a flowgroup or action selects which
columns to add. Preset, flowgroup, and action selections are additive.
Field |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
bool or list[string] |
No |
— |
Column names to add, or |
Value semantics:
list[string]— the metadata column names to add. Combined with the names selected at preset and flowgroup levels.false— at action level, disables all operational metadata for the action; overrides preset and flowgroup selections.true— accepted, but adds no columns. List the column names explicitly to add them.
Example¶
Define two columns in lhp.yaml and enable them on a load action.
# lhp.yaml
operational_metadata:
columns:
_ingested_at:
expression: "F.current_timestamp()"
applies_to: ["view"]
_source_file_path:
expression: "F.col('_metadata.file_path')"
applies_to: ["view"]
# pipelines/orders/load_orders.yaml
pipeline: orders
flowgroup: load_orders
actions:
- name: load_orders_raw
type: load
source:
type: cloudfiles
path: "${landing_volume}/orders/*.json"
format: json
operational_metadata:
- _ingested_at
- _source_file_path
target: v_orders_raw