-
Notifications
You must be signed in to change notification settings - Fork 433
feat(spanner): add ISO8601 duration support to spanner::Interval #15077
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
Conversation
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.
scotthart
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.
Reviewed 2 of 3 files at r1, all commit messages.
Reviewable status: 2 of 3 files reviewed, all discussions resolved
|
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. |
|
/gcbrun |
You're welcome.
That is my understanding too.
I already have that change lined up. It is congruent to the already-sent UUID one.
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 ReportAttention: Patch coverage is
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. 🚀 New features to boost your workflow:
|
|
/gcbrun |
|
/gcbrun |
In the pre-release specification for
TypeCode::INTERVAL, the wire encoding was given as a string in "intervalstyle == postgres" format, andspanner::Intervalwas implemented accordingly.By the time the feature was released in the backend, this encoding changed to be a string in ISO8601 duration format.
So:
Interval::operator std::string()to return a ISO8601 duration string.MakeInterval(absl::string_view)to recognize ISO8601 duration format.This change is