You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request]: Expose the full Debezium source metadata (pos, row, ts_ms, ...) in DebeziumIO JSON output #40701
SourceRecordJson (the mapper behind DebeziumIO.readAsJson() and the Python, Go and YAML ReadFromDebezium transforms) only keeps six fields from the Debezium source block: connector, version, name, db, schema and table. Everything else that Debezium emits there is dropped.
As @ilyasahsan123 pointed out in #39568 (comment), this makes it impossible to deduplicate MySQL change events downstream or to see when a change was committed. Beam today gives:
Missing in particular: pos and row (needed to order and deduplicate MySQL events), gtid, snapshot and ts_ms (database commit time). The same applies to other connectors, e.g. lsn and txId for PostgreSQL or change_lsn and commit_lsn for SQL Server.
Proposal
Add the complete source struct as a map under metadata.source, built from the struct's own schema, the same way before and after are already built. This is purely additive: the six existing metadata fields keep their names and values, so existing consumers keep working, and it covers every connector (and future Debezium fields) without hardcoding connector specific names.
Side note: for MySQL the binlog file is currently reported under metadata.schema. This proposal leaves that as is for compatibility, and the real file value becomes available under metadata.source.file.
Issue Priority
Priority: 2 (default / most feature requests should be filed as P2)
Hi, I'd like to work on this. I'd change SourceRecordJson.loadMetadata() to also add the whole source Struct as a map under metadata.source, built from its schema like loadBefore/loadAfter, keep the six existing fields as they are, and extend SourceRecordJsonTest. .take-issue
Activity
schizophrenicmaniac commentedon Oct 21, 2026
.take-issue
Hi, I'd like to work on this. I'd change SourceRecordJson.loadMetadata() to also add the whole source Struct as a map under metadata.source, built from its schema like loadBefore/loadAfter, keep the six existing fields as they are, and extend SourceRecordJsonTest. .take-issue
tkaymak commentedon Oct 21, 2026
@schizophrenicmaniac thank you, unfortunately I have already prepared the PR for this
[DebeziumIO] Expose the full Debezium source block in SourceRecordJso…
[DebeziumIO] Expose the full Debezium source block in SourceRecordJso…
[DebeziumIO] Add opt-in full metadata (op and Debezium source fields)…
[DebeziumIO] Expose full_metadata option in Python and Go ReadFromDeb…
[DebeziumIO] Expose full_metadata option in Python and Go ReadFromDeb…
[DebeziumIO] Add opt-in full metadata (op and Debezium source fields)…
[DebeziumIO] Add CHANGES.md entry for opt-in full metadata (#40701) (#…