Skip to content

feat: add support for UUID and PG_UUID types across Spanner migration utilities.#3905

Open
pratickchokhani wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
pratickchokhani:uuid-target-side
Open

feat: add support for UUID and PG_UUID types across Spanner migration utilities.#3905
pratickchokhani wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
pratickchokhani:uuid-target-side

Conversation

@pratickchokhani

Copy link
Copy Markdown
Contributor

No description provided.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.57%. Comparing base (65d422a) to head (6039a06).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../v2/spanner/migrations/avro/AvroToValueMapper.java 66.66% 2 Missing ⚠️
...m/google/cloud/teleport/v2/spanner/ddl/Column.java 87.50% 1 Missing ⚠️
...eport/v2/templates/transforms/AssignShardIdFn.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3905      +/-   ##
============================================
- Coverage     55.59%   55.57%   -0.02%     
- Complexity     7052     7056       +4     
============================================
  Files          1103     1103              
  Lines         67681    67753      +72     
  Branches       7603     7611       +8     
============================================
+ Hits          37625    37657      +32     
- Misses        27636    27672      +36     
- Partials       2420     2424       +4     
Components Coverage Δ
spanner-templates 88.47% <81.81%> (-0.02%) ⬇️
spanner-import-export 68.72% <ø> (+0.01%) ⬆️
spanner-live-forward-migration 90.23% <85.71%> (-0.02%) ⬇️
spanner-live-reverse-replication 84.41% <81.81%> (-0.03%) ⬇️
spanner-bulk-migration 92.61% <85.71%> (-0.02%) ⬇️
gcs-spanner-dv 88.89% <85.71%> (-0.02%) ⬇️
Files with missing lines Coverage Δ
...er/migrations/avro/GenericRecordTypeConvertor.java 96.27% <100.00%> (ø)
...ations/convertors/ChangeEventSpannerConvertor.java 85.24% <ø> (ø)
...igrations/convertors/ChangeEventTypeConvertor.java 88.05% <ø> (ø)
...2/spanner/migrations/spanner/SpannerReadUtils.java 88.15% <ø> (ø)
...om/google/cloud/teleport/v2/spanner/type/Type.java 99.46% <100.00%> (+0.01%) ⬆️
...m/google/cloud/teleport/v2/spanner/ddl/Column.java 90.96% <87.50%> (-0.17%) ⬇️
...eport/v2/templates/transforms/AssignShardIdFn.java 82.95% <0.00%> (-0.27%) ⬇️
.../v2/spanner/migrations/avro/AvroToValueMapper.java 93.53% <66.66%> (-0.72%) ⬇️

... and 4 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.

@pratickchokhani pratickchokhani force-pushed the uuid-target-side branch 12 times, most recently from b2bd219 to 4566208 Compare June 17, 2026 08:58
@pratickchokhani pratickchokhani force-pushed the uuid-target-side branch 4 times, most recently from 7924f38 to 368d1c1 Compare June 18, 2026 10:47
@pratickchokhani pratickchokhani marked this pull request as ready for review June 19, 2026 08:07
@pratickchokhani pratickchokhani requested a review from a team as a code owner June 19, 2026 08:07
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 first-class support for UUID and PG_UUID data types within the Spanner migration framework. By updating the core type system, mapping logic, and conversion utilities, the changes ensure that UUID fields are correctly identified, mapped, and processed during data migration tasks. These updates improve the robustness of the migration pipeline when dealing with UUID-based schemas.

Highlights

  • UUID Type Support: Added comprehensive support for UUID and PG_UUID types across Spanner migration utilities, including type definitions, mapping logic, and DDL handling.
  • Migration Utilities Updates: Updated Avro-to-Spanner mappers, change event converters, and Spanner read utilities to correctly handle UUID data types.
  • Testing and Validation: Expanded integration tests and schema definitions to validate UUID handling across various migration scenarios, including primary key support and data type conversion.
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 the 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 counterproductive. 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.

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.

@pratickchokhani pratickchokhani requested review from aasthabharill and removed request for shreyakhajanchi June 19, 2026 08:07

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the UUID and PG_UUID data types across several Spanner-related templates and common utilities, including schema parsing, Avro mapping, and change event conversion. A critical compilation issue was identified in AssignShardIdFn.java, where value.getUuid() is called on a Spanner Value object. Since the Spanner Java SDK does not have a getUuid() method, this must be updated to use value.getString() instead.

Comment on lines +698 to +700
case UUID:
case PG_UUID:
return value.getUuid();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The com.google.cloud.spanner.Value class does not have a getUuid() method. In the Cloud Spanner Java SDK, UUID values are retrieved as strings. Calling value.getUuid() will cause a compilation error. Please use value.getString() instead.

Suggested change
case UUID:
case PG_UUID:
return value.getUuid();
case UUID:
case PG_UUID:
return value.getString();

@pratickchokhani pratickchokhani Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. For UUID, we are receiving UUID value instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addition New feature or request size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant