Db2CdcStreamSrc
class Db2CdcStreamSrc(
tables: list[Db2TableNameSpec],
start_from: Db2CdcStartFromSpec,
columns_format: CdcColumnsFormatSpec = 'columns',
flatten_columns: bool = True,
src_cfg: CdcSrcCfgSpec | None = None,
)
Bases: StreamSrc
Categories: source
Db2 CDC stream source for @stream_publisher.
A streaming change-data-capture source: it emits one
tableframe-batch per capture-table flush across the tracked CD
(change-data) tables. Db2 SQL Replication captures changes into
shadow CD tables that the ASN capture program (asncap) populates
in the background. tables lists the CD tables (not the source
tables); the ingester resolves the source via
ASN.IBMSNAP_REGISTER. The decorated @stream_publisher
function receives the flushed batch as a list of frames and must NOT
declare a ctx parameter.
Parameters
start_fromDb2CdcStartFromSpec (Literal['head', 'tail'] | CommitSeqPosition | TableCommitSeqPosition | TimestampPosition)Where to begin -- "head" (replay each tracked CD
table from the origin), "tail" (each table's current
watermark), a CommitSeqPosition, a
TableCommitSeqPosition or a TimestampPosition.
columns_formatCdcColumnsFormatSpec (Literal['columns', 'struct', 'map'])Layout for the new (and old) columns payload on
each change row -- "columns" (default), "struct" or
"map".
src_cfgCdcSrcCfgSpec | None (Mapping[Literal['db2.cdc.blocking_timeout_seconds', 'db2.cdc.fetch_size', 'db2.cdc.logging_level', 'tabsdata.cdc.buffer.max_rows', 'tabsdata.cdc.buffer.max_bytes', 'tabsdata.cdc.buffer.max_secs', 'tabsdata.cdc.trigger.max_rows', 'tabsdata.cdc.trigger.max_bytes', 'tabsdata.cdc.trigger.max_secs', 'tabsdata.cdc.poll_interval_seconds'], Any] | None)Optional config mapping over the allowed CDC keys only -- buffer / trigger thresholds, polling cadence, server-side fetch size.