feat(datastream-to-SQL): Support DELETE replication for tables without Primary Keys using ROWID - #4232
feat(datastream-to-SQL): Support DELETE replication for tables without Primary Keys using ROWID#4232yonatandt wants to merge 5 commits into
Conversation
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 addresses a regression in the DatastreamToDML component where DELETE events for tables without primary keys were failing due to empty WHERE clauses. By implementing a ROWID fallback mechanism, the system can now correctly identify and process these deletions. Additionally, the changes improve the robustness of metadata field handling within DatastreamRow to ensure more reliable data processing. 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
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4232 +/- ##
============================================
+ Coverage 55.86% 55.89% +0.03%
- Complexity 7490 7507 +17
============================================
Files 1135 1135
Lines 70313 70357 +44
Branches 8040 8061 +21
============================================
+ Hits 39282 39329 +47
+ Misses 28480 28472 -8
- Partials 2551 2556 +5
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request introduces null-safety improvements in DatastreamRow when parsing JSON fields and primary keys, and adds fallback support for row IDs (rowid or _metadata_row_id) when generating DML templates and filters in DatastreamToDML for tables without primary keys. The feedback recommends handling column casing in the row ID fallback logic of getValueSql to prevent issues when casing rules are applied, and refactoring the primary key extraction in DatastreamRow to avoid redundant JSON node lookups.
- Fix regression in DatastreamToDML where tables lacking primary keys produced empty WHERE clauses for DELETE events. - Add ROWID fallback in getPrimaryKeyToValueFilterSql when primaryKeys is empty or unmapped. - Allow getDmlTemplate to generate DELETE DML when rowid or _metadata_row_id is present. - Make DatastreamRow getPrimaryKeys and getStringValue null-safe against missing metadata fields. - Add unit tests verifying ROWID fallback in DatastreamToDMLTest and DatastreamRowTest. Fixes b/506993545
da8f43e to
20c621d
Compare
…optimize primary key lookup
…achieve 100% patch coverage
…fallback WHERE filter
Fixes b/506993545