Skip to main content
GuideServerConfigure and deploy Tabsdata servers on your machine.TutorialsConfigure data integration workflows within a running Tabsdata server.Advanced TutorialsBuild end-to-end workflows between two specific systems.API ReferenceCLI ReferenceRelease Notes
Version: 2.0.0

Db2CdcStreamSrc

class
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

parameter

Qualified cd_schema.cd_table CD table names.

parameter
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.

parameter
columns_formatCdcColumnsFormatSpec (Literal['columns', 'struct', 'map'])

Layout for the new (and old) columns payload on each change row -- "columns" (default), "struct" or "map".

parameter
flatten_columnsbool

When True (default), the new columns are inlined as top-level columns.

parameter
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.