fix(datastream-to-bigquery): Added code to read SQLServer Primary Keys from replication_index instead of primary_keys metadata field (Issue #3805)#3844
Conversation
…s from replication_index instead of primary_keys metadata field (Issue GoogleCloudPlatform#3805)
|
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. |
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 an issue where SQL Server primary keys were not being correctly identified. By introducing a fallback mechanism to the 'replication_index' metadata field, the system now correctly handles primary key extraction for SQL Server sources while maintaining compatibility with existing MySQL, Oracle, and PostgreSQL implementations. 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
|
There was a problem hiding this comment.
Code Review
This pull request updates the getPrimaryKeys logic in both FormatDatastreamJsonToJson and FormatDatastreamRecordToJson to support a fallback to replication_index for SQL Server when primary_keys are missing. Comprehensive unit tests were added to verify this behavior across different database types and scenarios. Feedback was provided to optimize the implementation in FormatDatastreamRecordToJson by avoiding redundant schema lookups and expensive JSON parsing calls, suggesting a more efficient approach that aligns with the logic used in other parts of the codebase.
|
@dhercher could you please take a look? |
|
Hello @dhercher Is there any review feedback for this? |
This is a repeat and clean pull request for Issue #3805. This contains only changes associated with fixing the reading of SQLServer primary key from "replication_index" metadata field instead of "primary_key" field.
This replaces the earlier pull request #3806.