-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support Float as primary key for Mysql source #3016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Support Float as primary key for Mysql source #3016
Conversation
|
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. |
...e/cloud/teleport/v2/source/reader/io/jdbc/uniformsplitter/range/BoundarySplitterFactory.java
Outdated
Show resolved
Hide resolved
...google/cloud/teleport/v2/source/reader/io/jdbc/dialectadapter/mysql/MysqlDialectAdapter.java
Show resolved
Hide resolved
...e/cloud/teleport/v2/source/reader/io/jdbc/uniformsplitter/range/BoundarySplitterFactory.java
Outdated
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3016 +/- ##
============================================
+ Coverage 50.25% 55.36% +5.10%
+ Complexity 5021 1623 -3398
============================================
Files 967 465 -502
Lines 59261 26060 -33201
Branches 6458 2734 -3724
============================================
- Hits 29783 14427 -15356
+ Misses 27374 10760 -16614
+ Partials 2104 873 -1231
🚀 New features to boost your workflow:
|
… mapped a IndexType.OTHER)
66a089c to
374bd47
Compare
… passed to PartitionColumn. This is to allow the Boundary splitter to know what decimal precision is used by the source column. - Update Boundary.isSplittable to support FLOAT by doing delta based compare between 2 values. Either use a small default delta step size or the one provided the source db column. - Update MysqlDialectAdapter to pass the Numeric-scale schema value of Float column as DecimalStepSize to SourceColumnIndexInfo
…behavior (with DecimalsStep paramater)
.../java/com/google/cloud/teleport/v2/source/reader/io/jdbc/uniformsplitter/range/Boundary.java
Show resolved
Hide resolved
...google/cloud/teleport/v2/source/reader/io/jdbc/dialectadapter/mysql/MysqlDialectAdapter.java
Show resolved
Hide resolved
...le/cloud/teleport/v2/source/reader/io/jdbc/dialectadapter/mysql/MysqlDialectAdapterTest.java
Outdated
Show resolved
Hide resolved
…ks with approximate delta based comparisons)
|
@VardhanThigle I made the changes we discussed during the meeting:
I think the PR is now ready but of course let me know if you see anything missing. Thank you |
In the SourceDB -> Spanner flow, add support for Float type primary key for Mysql source.
UniformSplitter: Add a boundary extractor and splitter (split the range of value in 2) for Float value
Because Float is an approximate values, we need additional changes:
DataflowTemplates/v2/sourcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/source/reader/io/jdbc/uniformsplitter/range/PartitionColumn.java
Line 26 in a73e0f0
Source IndexType: Add a new IndexType.Float which map internally to Java Float.class
MysqlDialectAdapter: Map Mysql source FLOAT column type to the newly created IndexType above
Add Integration tests in v2/sourcedb-to-spanner/src/test/resources/DataTypesIT