-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Feat: Add GCS sink to bulk migration pipeline #3139
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?
Conversation
Summary of ChangesHello @manitgupta, 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 introduces a significant enhancement to the bulk migration pipeline by providing an option to output migrated data directly to Google Cloud Storage in Avro format. This functionality allows users to archive or further process the source records outside of the primary Spanner migration, offering greater flexibility in data handling. The changes also ensure that the infrastructure-as-code definitions are aligned with these new pipeline capabilities. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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 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 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
|
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (17.02%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3139 +/- ##
============================================
+ Coverage 50.70% 56.08% +5.38%
+ Complexity 5070 1713 -3357
============================================
Files 974 474 -500
Lines 59872 26738 -33134
Branches 6536 2814 -3722
============================================
- Hits 30360 14997 -15363
+ Misses 27370 10847 -16523
+ Partials 2142 894 -1248
🚀 New features to boost your workflow:
|
ea9335a to
4ffaf30
Compare
rohitwali
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the changes. could you also share links to success jobs during integration and scale tests?
| FileSystems.matchNewResource(options.getGcsOutputDirectory(), true) | ||
| .resolve(shardId, StandardResolveOptions.RESOLVE_DIRECTORY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are the pros/cons of choosing this over gcs_dir/table/shardId? are there other folder structures considered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is a large advantage of one over the other, and this change-able if we see most customers asking for the other.
gcs_dir/shardId/table felt natural to me since today we shard jobs by shards (if we have to) instead of by table.
...b-to-spanner/src/main/java/com/google/cloud/teleport/v2/templates/MigrateTableTransform.java
Outdated
Show resolved
Hide resolved
...b-to-spanner/src/main/java/com/google/cloud/teleport/v2/templates/MigrateTableTransform.java
Outdated
Show resolved
Hide resolved
...b-to-spanner/src/main/java/com/google/cloud/teleport/v2/templates/MigrateTableTransform.java
Show resolved
Hide resolved
...b-to-spanner/src/main/java/com/google/cloud/teleport/v2/templates/MigrateTableTransform.java
Outdated
Show resolved
Hide resolved
...b-to-spanner/src/main/java/com/google/cloud/teleport/v2/templates/MigrateTableTransform.java
Show resolved
Hide resolved
...ourcedb-to-spanner/src/main/java/com/google/cloud/teleport/v2/templates/AvroDestination.java
Show resolved
Hide resolved
...b-to-spanner/src/main/java/com/google/cloud/teleport/v2/templates/MigrateTableTransform.java
Show resolved
Hide resolved
| PCollectionTuple rowsAndTables = input.apply("Read_rows", readerTransform.readTransform()); | ||
| PCollection<SourceRow> sourceRows = rowsAndTables.get(readerTransform.sourceRowTag()); | ||
|
|
||
| if (options.getGcsOutputDirectory() != null && !options.getGcsOutputDirectory().isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thinking out loud, should this be behind a enable data validation flag instead of GCS DIR flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am open to it, although GCS sink functionality is a more general one, with a usage in validation. We can rename to something like gcsValidationOutputDirectory but I would advise against that.
Links and observations during testing are documented here: b/470879633 |
Changes
avrofiles to GCS. Files are organized in the structure offolder -> shard-level folder -> table-level folder -> .avro files.Testing