DataflowTemplates icon indicating copy to clipboard operation
DataflowTemplates copied to clipboard

Support for Bool as a primary key

Open gpalanisamyYopp opened this issue 1 year ago • 6 comments

gpalanisamyYopp avatar Dec 03 '25 16:12 gpalanisamyYopp

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.

google-cla[bot] avatar Dec 03 '25 16:12 google-cla[bot]

Summary of Changes

Hello @gpalanisamyYopp, I'm Gemini Code Assist[^1]! 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 the capability to handle MySQL BOOL data types during schema discovery and data migration to Spanner. It ensures that BOOL columns are correctly identified and mapped to an appropriate numeric type (INT64) in the target Spanner database, accompanied by thorough testing to confirm the integrity of this mapping. This enhancement improves the compatibility and robustness of the migration tool for MySQL databases.

Highlights

  • MySQL BOOL Type Support: Added support for mapping MySQL's BOOL data type to NUMERIC (specifically INT64 in Spanner) within the data migration process.
  • Dialect Adapter Update: The MysqlDialectAdapter has been updated to correctly identify BOOL columns and assign them the NUMERIC index type during schema discovery.
  • Comprehensive Testing: New unit tests and integration tests have been introduced to validate the correct handling and mapping of BOOL types, including the creation of a bool_pk_table and insertion of boolean values.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: 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.

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.

[^1]: 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.

gemini-code-assist avatar Dec 03 '25 16:12 gemini-code-assist

Please resolve the merge conflicts and fix the spotless and checksyle issues.

VardhanThigle avatar Dec 08 '25 09:12 VardhanThigle

Spotless still needs to be fixed.

VardhanThigle avatar Dec 08 '25 18:12 VardhanThigle

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 55.65%. Comparing base (301cd41) to head (ce23992). :warning: Report is 24 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3045      +/-   ##
============================================
+ Coverage     50.41%   55.65%   +5.24%     
+ Complexity     5022     1614    -3408     
============================================
  Files           970      468     -502     
  Lines         59606    26362   -33244     
  Branches       6506     2771    -3735     
============================================
- Hits          30051    14673   -15378     
+ Misses        27434    10798   -16636     
+ Partials       2121      891    -1230     
Components Coverage Δ
spanner-templates 71.62% <100.00%> (+0.97%) :arrow_up:
spanner-import-export ∅ <ø> (∅)
spanner-live-forward-migration 80.03% <ø> (ø)
spanner-live-reverse-replication 77.46% <ø> (ø)
spanner-bulk-migration 88.25% <100.00%> (+<0.01%) :arrow_up:
Files with missing lines Coverage Δ
...jdbc/dialectadapter/mysql/MysqlDialectAdapter.java 99.62% <100.00%> (+<0.01%) :arrow_up:

... and 521 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Dec 09 '25 06:12 codecov[bot]

Spotless still needs to be fixed.

VardhanThigle avatar Dec 09 '25 06:12 VardhanThigle

PLease fix the integration test.

VardhanThigle avatar Dec 11 '25 09:12 VardhanThigle

Please rebase the PR on top of the tree to get the integration tests to passing state.

VardhanThigle avatar Dec 15 '25 08:12 VardhanThigle

I unfortunately don't have permissions to push to the fork and the developer that owns this is out of office for the rest of the year. I've re-created the PR but up-to-date with main in #3112.

nmemond avatar Dec 15 '25 14:12 nmemond

Closing this as #3112 is raised to cover this.

VardhanThigle avatar Dec 15 '25 16:12 VardhanThigle