[googlecloud-to-googlecloud] Add Spanner Capture Type: NEW_ROW_AND_OLD_VALUES for AVRO files #3846
[googlecloud-to-googlecloud] Add Spanner Capture Type: NEW_ROW_AND_OLD_VALUES for AVRO files #3846ahlie88 wants to merge 1 commit into
Conversation
…D_VALUES for AVRO files The capture type NEW_ROW_AND_OLD_VALUES is mapped as NEW_VALUES when generating avro files for Spanner Change Stream.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces support for the NEW_ROW_AND_OLD_VALUES capture type within the Spanner Change Stream to Avro transformation pipeline. By updating both the internal mapping logic and the Avro schema definition, the system can now properly distinguish and process this capture type instead of defaulting to NEW_VALUES. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request adds support for the NEW_ROW_AND_OLD_VALUES capture type by updating the mapping logic in WriteDataChangeRecordsToAvro and the corresponding Avro schema definition. The reviewer recommends adding a unit test to verify the mapping for this new type, as existing tests are limited to the OLD_AND_NEW_VALUES type.
| case NEW_ROW_AND_OLD_VALUES: | ||
| return com.google.cloud.teleport.v2.ValueCaptureType.NEW_ROW_AND_OLD_VALUES; |
There was a problem hiding this comment.
The new capture type NEW_ROW_AND_OLD_VALUES is correctly added to the mapping. However, it is recommended to add a corresponding unit test in WriteDataChangeRecordsToAvroTest.java to verify that this new type is correctly mapped to the Avro equivalent. Currently, the existing tests only cover OLD_AND_NEW_VALUES.
The capture type NEW_ROW_AND_OLD_VALUES is mapped as NEW_VALUES when generating avro files for Spanner Change Stream. This PR is target to correct the mapping, and use NEW_ROW_AND_OLD_VALUES as is in the generated avro file.