Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DBZ-PGYB] Add transformer PGCompatible to emit events with standard structure #168

Open
wants to merge 3 commits into
base: ybdb-debezium-2.5.2
Choose a base branch
from

Conversation

vaibhav-yb
Copy link
Collaborator

This PR adds a transformer PGCompatible with full path io.debezium.connector.postgresql.transforms.yugabytedb, this will be helpful in converting the structure of the emitted events to match the one emitted by standard Debezium connectors.

Example:
Consider the following schema for a table test: (id INT PRIMARY KEY, name TEXT, age INT)

  • If a record is inserted having values (1, 'John Doe', 25) then after using the above transformer, the payload of the record would look like:
"payload": {
  "id": 1,
  "name": "John Doe",
  "age": 25
}
  • If the same record is now updated and age is changed to 30 i.e. UPDATE test SET age = 30 WHERE id = 1; then the payload would look like:
"payload": {
  "id": 1,
  "name": null,
  "age": 30
}

NOTE: The above example assumes that the replica identity of the table is CHANGE and that is how the assumption was made that the UPDATE event will not contain the value for the fields which were not updated. For more information on replica identity, see YugabyteDB docs.

@vaibhav-yb vaibhav-yb added the enhancement New feature or request label Dec 23, 2024
@vaibhav-yb vaibhav-yb self-assigned this Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant