Skip to content

Conversation

@claudevdm
Copy link
Collaborator

@claudevdm claudevdm commented Nov 17, 2025

This adds support for the micros instant logical type in spanner IO reads and writes.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@claudevdm claudevdm force-pushed the spanner-microsinstant branch from 1803689 to 1844618 Compare November 18, 2025 02:17
@claudevdm claudevdm marked this pull request as ready for review November 18, 2025 14:54
@github-actions
Copy link
Contributor

Assigning reviewers:

R: @shunping for label python.
R: @Abacn for label java.
R: @nielm for label spanner.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@claudevdm
Copy link
Collaborator Author

/gemini review

Copy link
Contributor

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

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 microsecond-precision timestamps (MicrosInstant logical type) in SpannerIO. The changes correctly handle the conversion between java.time.Instant and Spanner's Timestamp for both writing and reading data. The integration tests have also been updated to cover this new functionality.

My review focuses on improving code maintainability by reducing duplication and enhancing the completeness of the integration tests. I've identified a few areas where helper methods could be introduced to centralize conversion logic, and a couple of test cases where assertions could be made more robust.

Copy link
Contributor

@Abacn Abacn left a comment

Choose a reason for hiding this comment

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

LGTM after dedup conversion logics suggested by AI code review

@claudevdm claudevdm changed the title Support micros isntant in spannerio. Support beam:logical_type:micros_instant:v1 in SpannerIo. Nov 18, 2025
Copy link
Contributor

@nielm nielm left a comment

Choose a reason for hiding this comment

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

Please also implement the gemini code assist changes...

@claudevdm claudevdm force-pushed the spanner-microsinstant branch from cdccfd4 to e6d62fe Compare November 19, 2025 16:10
@claudevdm
Copy link
Collaborator Author

@nielm can you please take another look?

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 76.92308% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.34%. Comparing base (c8d7ca0) to head (c170f82).
⚠️ Report is 31 commits behind head on master.

Files with missing lines Patch % Lines
.../apache/beam/sdk/io/gcp/spanner/MutationUtils.java 74.28% 6 Missing and 3 partials ⚠️
...rg/apache/beam/sdk/io/gcp/spanner/StructUtils.java 82.35% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #36840   +/-   ##
=========================================
  Coverage     40.33%   40.34%           
- Complexity     3456     3469   +13     
=========================================
  Files          1225     1225           
  Lines        187817   187859   +42     
  Branches       3586     3597   +11     
=========================================
+ Hits          75762    75793   +31     
- Misses       108665   108668    +3     
- Partials       3390     3398    +8     
Flag Coverage Δ
java 70.56% <76.92%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants