tkaymak opened a new pull request, #40702: URL: https://github.com/apache/beam/pull/40702
Fixes #40701. `SourceRecordJson` (behind `readAsJson()` and the Python/Go `ReadFromDebezium`) only kept six fields of the Debezium `source` struct, so values like MySQL `pos`/`row`/`gtid`/`ts_ms` or PostgreSQL `lsn`/`ts_ms` were lost. Users need them to deduplicate events and to get the database commit time (see https://github.com/apache/beam/issues/39568#issuecomment-6105370007). This adds the complete struct as `metadata.source`, keyed by field name in schema order. The existing six fields keep their names, values and order. Source fields are flat primitives for all supported connectors and are serialized the same way as `before`/`after`. Each record carries roughly 10 to 17 more small fields; users with a strict downstream schema can drop `metadata.source` (noted under Breaking Changes in CHANGES.md). YAML `ReadFromDebezium` uses the Row path and is not affected. **Testing** - `:sdks:java:io:debezium:test` and `:sdks:java:io:debezium:check` pass. - `DebeziumIOMySqlConnectorIT` and `DebeziumIOPostgresSqlConnectorIT` pass locally against Docker; they now assert connector specific keys in `metadata.source` and compare the rest of the event as before. - The Python and Go xlang ITs got the same treatment. They only run in PostCommit Python and PostCommit XVR Direct, so those trigger files are touched to run them on this PR. R: @Abacn cc @ilyasahsan123 ------------------------ Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead. - [x] Update `CHANGES.md` with noteworthy changes. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
