-
Notifications
You must be signed in to change notification settings - Fork 293
codec: fix a panic in Debezium when configuring column-selector #12210
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @wk989898, 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 resolves a panic in the Debezium codec that occurs when using column-selector and encountering nil columns. The fix involves adding nil checks in the encoding logic to safely handle these cases. Integration tests have been added to ensure the fix works as expected and to prevent regressions.
Highlights
- Bug Fix: Addresses a panic in the Debezium codec when column-selector is configured and some columns are nil.
- Codec Modification: The code now includes a nil check for columns in
writeDebeziumFieldValues
andEncodeValue
to prevent panics. - Integration Test: Integration tests were added to verify the fix, including a changefeed configuration with column selectors.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize 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 .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively resolves a panic in the Debezium codec when using column-selector
. The fix is straightforward, adding necessary nil
checks for filtered columns. The changes are well-supported by a new integration test case that validates the fix. The overall implementation is solid.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #12210 +/- ##
================================================
- Coverage 55.0702% 55.0649% -0.0054%
================================================
Files 1030 1030
Lines 143484 143487 +3
================================================
- Hits 79017 79011 -6
- Misses 58658 58668 +10
+ Partials 5809 5808 -1 🚀 New features to boost your workflow:
|
/retest |
colInfos := tableInfo.GetColInfosForRowChangedEvent() | ||
writer.WriteObjectField(fieldName, func() { | ||
for i, col := range cols { | ||
if col == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can add one unit test to cover this
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 3AceShowHand, hongyunyan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
/retest |
/retest-required |
1 similar comment
/retest-required |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
What problem does this PR solve?
Issue Number: close #12208
What is changed and how it works?
When configuring the column-selector, some columns that are not selected must be ignored. Because these columns are
nil
and cause a panic when encoding.This pr also fixes other integration tests. When running two SQL and checking that the same table exists, the second SQL may not replicate to the downstream.
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note