On this page

Write actions

Every write sets type: write and a write_target mapping. Choose a target and mode for a complete example, target settings and action fields. For worked examples and help choosing a target, see Write.

Action fields

These fields sit on the action, alongside write_target.

Field

Type

Default

Requirement and behaviour

name

string

required

Action name, unique within the flowgroup.

type

string

required

Always write.

source

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 snapshot_cdc_config. Materialized views require one of action source, target sql or target sql_path.

write_target

mapping

required

Target settings; type selects streaming_table, materialized_view or sink.

description

string

derived

Comment/docstring for the generated flow or view.

readMode

string

stream

stream or batch for standard streaming-table append flows. Replace requires streaming; replace_where reads in batch and rejects stream. Materialized views use batch queries; sinks use streaming reads. The read must match the kind of the view it reads, or lhp validate fails with LHP-VAL-070; a batch read in a standard streaming-table flow also needs once: true.

once

bool

false

Emits once=True for standard append and CDC flows. Not emitted for snapshot CDC, replace, replace_where, materialized views or sinks.

operational_metadata

bool / list

—

Accepted on the model; writes do not add metadata columns. Select columns on load or supported transform actions instead.

depends_on

list[string]

—

Extra upstream table/view references. See Dependency analysis reference.

Shared fields

Table and materialized-view pages include their shared target options alongside their mode-specific settings.

Streaming table

Append to a streaming table: syntax and options.

mode: cdc

CDC streaming table: syntax and options.

mode: snapshot_cdc

Snapshot CDC streaming table: syntax and options.

mode: replace

Replace rows in a streaming table: syntax and options.

mode: replace_where

Replace rows matching a predicate: syntax and options.

Materialized view

Materialized view: syntax and options.

Sink

Sink: syntax and options.

Emitted constructs

  • standard: dp.create_streaming_table(...) (when create_table is true) plus one @dp.append_flow(target=, name=, comment=) decorator per source view.

  • cdc: dp.create_streaming_table(...) (when create_table is true) plus dp.create_auto_cdc_flow(...).

  • snapshot_cdc: dp.create_streaming_table(...) (always) plus dp.create_auto_cdc_from_snapshot_flow(...).

  • replace: dp.create_streaming_table(...) (always) plus a single @dp.replace_flow(target=, name=, replace_using=, sequence_by=, comment=) decorator.

  • replace_where: a single @dp.table(name=, comment=, table_properties=, replace_where=) decorator over a batch read, with no dp.create_streaming_table(...); the table and its flow are one statement.

sink_type-specific fields

See Sink for Delta, Kafka, Event Hubs, foreachbatch and custom sinks.

Unity Catalog tags

Table-level tags and tags_file belong on write_target. See Unity Catalog tagging for project settings and runtime behaviour.

uc_tagging config block

The project block is documented in Unity Catalog tagging.

How the hook applies tags

See Unity Catalog tagging for hook behaviour and permissions.

Schema & tags file

See Schema and tag files for the shared file format.

Tagging error handling

See Unity Catalog tagging for warnings and event-log diagnosis.