Skip to content

Conversation

@devbww
Copy link
Contributor

@devbww devbww commented Apr 9, 2025

In the pre-release specification for TypeCode::INTERVAL, the wire encoding was given as a string in "intervalstyle == postgres" format, and spanner::Interval was implemented accordingly.

By the time the feature was released in the backend, this encoding changed to be a string in ISO8601 duration format.

So:

  • Change Interval::operator std::string() to return a ISO8601 duration string.
  • Extend MakeInterval(absl::string_view) to recognize ISO8601 duration format.
  • Update and extend the test cases accordingly.

This change is Reviewable

In the pre-release specification for `TypeCode::INTERVAL`, the wire
encoding was given as a string in "intervalstyle == postgres" format,
and `spanner::Interval` was implemented accordingly.

By the time the feature was released in the backend, this encoding
changed to be a string in ISO8601 duration format.

So:
- Change `Interval::operator std::string()` to return a ISO8601
  duration string.
- Extend `MakeInterval(absl::string_view)` to recognize ISO8601
  duration format.
- Update and extend the test cases accordingly.
@devbww devbww requested a review from a team as a code owner April 9, 2025 23:32
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Apr 10, 2025
Copy link
Member

@scotthart scotthart left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 3 files at r1, all commit messages.
Reviewable status: 2 of 3 files reviewed, all discussions resolved

@scotthart
Copy link
Member

Thanks for these updates!

My understanding is that Interval support has been rolled out in production, so at some point in the near future we'll look at adding Interval to google/cloud/spanner/value.[h|cc] and some integration tests.

@scotthart
Copy link
Member

/gcbrun

@devbww
Copy link
Contributor Author

devbww commented Apr 10, 2025

Thanks for these updates!

You're welcome.

My understanding is that Interval support has been rolled out in production,

That is my understanding too.

so at some point in the near future we'll look at adding Interval to google/cloud/spanner/value.[h|cc]

I already have that change lined up. It is congruent to the already-sent UUID one.

and some integration tests.

Yes, but you'll be on your own there (and for UUID) as I don't have the resources to run integration tests. My plan was to file two issues (Interval and UUID) pointing at the appropriate tests.

@codecov
Copy link

codecov bot commented Apr 10, 2025

Codecov Report

Attention: Patch coverage is 96.77419% with 7 lines in your changes missing coverage. Please review.

Project coverage is 92.90%. Comparing base (6e34f52) to head (1b0b85f).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
google/cloud/spanner/interval_test.cc 93.06% 7 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #15077    +/-   ##
========================================
  Coverage   92.90%   92.90%            
========================================
  Files        2354     2354            
  Lines      210365   210488   +123     
========================================
+ Hits       195441   195564   +123     
  Misses      14924    14924            

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

@scotthart
Copy link
Member

/gcbrun

@scotthart
Copy link
Member

/gcbrun

@scotthart scotthart merged commit bfa8cdb into googleapis:main Apr 16, 2025
77 of 79 checks passed
@devbww devbww deleted the interval-string branch April 16, 2025 16:51
devbww added a commit to devbww/google-cloud-cpp that referenced this pull request Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants