Skip to content

Conversation

@pratickchokhani
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @pratickchokhani, 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 data transformation pipeline for Spanner by introducing robust handling for generated columns. The core change involves identifying these read-only columns and ensuring they are not included in write operations, thereby preventing errors and maintaining data integrity. This improvement is crucial for seamless data migration and synchronization with Spanner, especially when dealing with schemas that leverage generated fields.

Highlights

  • Generated Column Filtering: Implemented logic to identify and filter out Spanner generated columns during data transformation processes, preventing attempts to write to these read-only fields.
  • Schema Mapper Extension: Added a new isGeneratedColumn method to the ISchemaMapper interface and provided implementations across various mapper types (IdentityMapper, SchemaFileOverridesBasedMapper, SchemaStringOverridesBasedMapper, SessionBasedMapper).
  • Avro Record Conversion Enhancement: Modified GenericRecordTypeConvertor to utilize the new isGeneratedColumn method, ensuring that generated columns are skipped when converting Avro GenericRecord instances to Spanner Value maps.
  • Comprehensive Testing: Introduced new unit tests in SourceRowToMutationDoFnTest and GenericRecordTypeConvertorTest to validate the correct filtering behavior of generated columns during mutation creation and Avro record conversion, respectively.
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.

@pratickchokhani pratickchokhani added addition New feature or request improvement Making existing code better and removed size/L addition New feature or request labels Jan 26, 2026
@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

❌ Patch coverage is 27.27273% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.34%. Comparing base (18ea97b) to head (2735749).

Files with missing lines Patch % Lines
...rations/schema/SchemaFileOverridesBasedMapper.java 0.00% 7 Missing ⚠️
...tions/schema/SchemaStringOverridesBasedMapper.java 0.00% 7 Missing ⚠️
.../spanner/migrations/schema/SessionBasedMapper.java 50.00% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (27.27%) 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    #3254      +/-   ##
============================================
+ Coverage     50.93%   56.34%   +5.40%     
+ Complexity     5159     1724    -3435     
============================================
  Files           977      473     -504     
  Lines         60351    26886   -33465     
  Branches       6596     2840    -3756     
============================================
- Hits          30740    15149   -15591     
+ Misses        27461    10830   -16631     
+ Partials       2150      907    -1243     
Components Coverage Δ
spanner-templates 72.08% <27.27%> (+1.03%) ⬆️
spanner-import-export ∅ <ø> (∅)
spanner-live-forward-migration 79.88% <27.27%> (-0.25%) ⬇️
spanner-live-reverse-replication 77.48% <27.27%> (-0.25%) ⬇️
spanner-bulk-migration 88.28% <27.27%> (-0.18%) ⬇️
Files with missing lines Coverage Δ
...er/migrations/avro/GenericRecordTypeConvertor.java 96.24% <100.00%> (+0.02%) ⬆️
...t/v2/spanner/migrations/schema/IdentityMapper.java 100.00% <100.00%> (ø)
.../spanner/migrations/schema/SessionBasedMapper.java 92.36% <50.00%> (-1.22%) ⬇️
...rations/schema/SchemaFileOverridesBasedMapper.java 79.74% <0.00%> (-7.76%) ⬇️
...tions/schema/SchemaStringOverridesBasedMapper.java 73.91% <0.00%> (-6.09%) ⬇️

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

…g data transformation to prevent writing to read-only fields.
@pratickchokhani pratickchokhani marked this pull request as ready for review February 2, 2026 10:50
@pratickchokhani pratickchokhani requested a review from a team as a code owner February 2, 2026 10:50
@pratickchokhani pratickchokhani changed the title feat(Spanner): Implement filtering of Spanner generated columns during data transformation to prevent writing to read-only fields. feat(Spanner): Bulk template generated column support Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Making existing code better size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant