support for date as primary key
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 enhances the sourcedb-to-spanner tool by introducing explicit support for the MySQL DATE data type. It ensures that DATE columns are correctly recognized and mapped as TIME_STAMP during schema discovery and data migration, with comprehensive unit and integration tests to validate this new functionality.
Highlights
- MySQL DATE Type Mapping: The MySQL
DATEdata type is now explicitly mapped toIndexType.TIME_STAMPwithin theMysqlDialectAdapter, ensuring consistent handling during schema discovery. - Unit Test Updates: The
MysqlDialectAdapterTesthas been updated to includeDATEin its column type discovery tests, verifying that the new mapping is correctly processed. - Integration Test Expansion: New integration tests have been added for the
DATEdata type, including adate_pk_tableinmysql-data-types.sqland its corresponding Spanner schema inmysql-spanner-schema.sql, along with expected data inMySQLDataTypesIT.java.
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.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 55.64%. Comparing base (301cd41) to head (848cea7).
:warning: Report is 5 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #3082 +/- ##
============================================
+ Coverage 50.41% 55.64% +5.23%
+ Complexity 5022 1613 -3409
============================================
Files 970 468 -502
Lines 59606 26362 -33244
Branches 6506 2771 -3735
============================================
- Hits 30051 14670 -15381
+ Misses 27434 10800 -16634
+ Partials 2121 892 -1229
| Components | Coverage Δ | |
|---|---|---|
| spanner-templates | 71.60% <100.00%> (+0.95%) |
:arrow_up: |
| spanner-import-export | ∅ <ø> (∅) |
|
| spanner-live-forward-migration | 80.03% <ø> (ø) |
|
| spanner-live-reverse-replication | 77.42% <ø> (-0.05%) |
:arrow_down: |
| 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: |
: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.
Conflicts + Title need to be updated to mention this is for Primary key support. Other than that looks good to me.
Please fix spotless.
Please fix the build, UT all lines of code touched, fix spotless before pushing the changes so as to avoid back and forth..
Is there an import missing? The build is not yet fixed.
Build is still borken
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project sourcedb-to-spanner: Compilation failure
/home/runner/actions-runner/_work/DataflowTemplates/DataflowTemplates/v2/sourcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/source/reader/io/jdbc/uniformsplitter/range/BoundarySplitterFactory.java:[208,55] cannot find symbol
symbol: variable DateTimeFormatter
location: class com.google.cloud.teleport.v2.source.reader.io.jdbc.uniformsplitter.range.BoundarySplitterFactory