On this page
Snapshot CDC streaming table¶
mode: snapshot_cdc requires a snapshot_cdc_config block and forces
create_table: true. Fields under write_target.snapshot_cdc_config:
Minimal example¶
Add this entry to the actions list in your flowgroup.
- name: write_customer_snapshot
type: write
write_target:
type: streaming_table
mode: snapshot_cdc
catalog: "${catalog}"
schema: "${silver_schema}"
table: customer_dim
snapshot_cdc_config:
source: "${catalog}.${bronze_schema}.customer_snapshot"
keys: ["customer_id"]
stored_as_scd_type: 2
With the direct source form shown here, the containing flowgroup must
also have a load action under the current relationship validator. A snapshot
write using source_function can be the only action; the
worked guide shows that form.
Options¶
Key |
Type |
Default |
Notes |
|---|---|---|---|
|
string |
one-of |
External table/path; exactly one of |
|
dict |
one-of |
|
|
list[string] |
required |
Non-empty. |
|
int |
|
|
|
list[string] |
— |
Mutually exclusive with |
|
list[string] |
— |
Mutually exclusive with |
With source_function, each parameters entry is bound as a keyword
argument via functools.partial (the function must declare them as
keyword-only args after *); source_function.file is copied alongside
the generated pipeline and resolved relative to project root.
Action fields¶
These fields sit on the action, alongside write_target.
Field |
Type |
Default |
Requirement and behaviour |
|---|---|---|---|
|
string |
required |
Action name, unique within the flowgroup. |
|
string |
required |
Always |
|
string / list |
conditional |
Input view(s). Standard streaming writes and most sinks accept a list. CDC, replace, replace_where and foreachbatch use one view. Snapshot CDC takes its source inside |
|
mapping |
required |
Target settings; |
|
string |
derived |
Comment/docstring for the generated flow or view. |
|
string |
|
|
|
bool |
|
Emits |
|
bool / list |
— |
Accepted on the model; writes do not add metadata columns. Select columns on load or supported transform actions instead. |
|
list[string] |
— |
Extra upstream table/view references. See Dependency analysis reference. |