Skip to content

Conversation

@nmemond
Copy link
Contributor

@nmemond nmemond commented Dec 15, 2025

This is a copy of #3082 but up-to-date with main (and a minor fix for converting date to/from a numerical value), because that developer is out of office for the rest of the year and I don't have permissions to push to their fork.

@nmemond nmemond requested a review from a team as a code owner December 15, 2025 14:57
@gemini-code-assist
Copy link

Summary of Changes

Hello @nmemond, 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 enhances the Spanner bulk data migration tool by adding robust support for DATE columns serving as primary keys in MySQL source databases. The changes ensure that DATE types are properly identified, their ranges can be efficiently split for optimized data transfer, and the overall migration process handles them without issues. This update improves the tool's compatibility and reliability for a wider array of database schemas.

Highlights

  • Date Primary Key Support: Introduced comprehensive support for DATE data types when used as primary keys in MySQL for Spanner bulk data migration. This includes recognizing DATE as a valid index type and enabling its use in range splitting.
  • Boundary Splitting for Dates: Implemented new logic within BoundarySplitterFactory to correctly split java.sql.Date ranges, facilitating parallel processing for tables with DATE primary keys.
  • Schema and Test Updates: Updated the SourceColumnIndexInfo to include DATE as an IndexType and extended various test suites (dialect adapter tests, boundary splitter tests, and integration tests) to validate the new DATE primary key functionality end-to-end.
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 👍 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.

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

  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.

@nmemond nmemond marked this pull request as draft December 15, 2025 15:24
@nmemond nmemond changed the title Spanner bulk data migration: Support for Date as a primary key Spanner bulk data migration: Support for Date as a primary key Dec 15, 2025
@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.86%. Comparing base (bf172e2) to head (5962949).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3113      +/-   ##
============================================
+ Coverage     50.49%   55.86%   +5.37%     
+ Complexity     5038     1640    -3398     
============================================
  Files           973      471     -502     
  Lines         59718    26496   -33222     
  Branches       6510     2776    -3734     
============================================
- Hits          30154    14802   -15352     
+ Misses        27435    10797   -16638     
+ Partials       2129      897    -1232     
Components Coverage Δ
spanner-templates 71.85% <100.00%> (+1.08%) ⬆️
spanner-import-export ∅ <ø> (∅)
spanner-live-forward-migration 80.08% <ø> (-0.02%) ⬇️
spanner-live-reverse-replication 77.73% <ø> (-0.02%) ⬇️
spanner-bulk-migration 88.25% <100.00%> (+0.02%) ⬆️
Files with missing lines Coverage Δ
...jdbc/dialectadapter/mysql/MysqlDialectAdapter.java 99.62% <100.00%> (+<0.01%) ⬆️
...source/reader/io/jdbc/iowrapper/JdbcIoWrapper.java 92.89% <ø> (ø)
...niformsplitter/range/BoundaryExtractorFactory.java 100.00% <100.00%> (ø)
...uniformsplitter/range/BoundarySplitterFactory.java 100.00% <100.00%> (ø)
...source/reader/io/schema/SourceColumnIndexInfo.java 68.00% <100.00%> (+1.33%) ⬆️

... and 521 files with indirect coverage changes

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

@pull-request-size pull-request-size bot added size/L and removed size/M labels Dec 15, 2025
@nmemond nmemond marked this pull request as ready for review December 15, 2025 17:26
VardhanThigle
VardhanThigle previously approved these changes Dec 16, 2025
@nmemond nmemond force-pushed the source-to-spanner-mysql-date-timestamp branch from cf0b1b7 to 5962949 Compare December 16, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants