chore(spanner): add DATE and TIMESTAMP codecs for key recipe routing - #6288
chore(spanner): add DATE and TIMESTAMP codecs for key recipe routing#6288olavloite wants to merge 1 commit into
Conversation
Add a standalone temporal codecs module (`routing::temporal`) to support Spanner `DATE` and `TIMESTAMP` key column evaluation in location-aware routing. This implementation parses ISO 8601 date strings into days since Unix epoch and RFC 3339 timestamp strings into UTC offset seconds and nanoseconds, converting them into Spanner's ordered binary format (`ssformat`). The module includes full support for valid Spanner date ranges (`0001-01-01` to `9999-12-31`), non-UTC timezone offsets, leap second normalization, and verification of chronological sort order preservation.
There was a problem hiding this comment.
Code Review
This pull request introduces a new temporal module in the Spanner routing crate, implementing codecs for DATE and TIMESTAMP data types to support location-aware routing. It includes robust parsing and encoding functions to convert ISO 8601 dates and RFC 3339 timestamps into Spanner's binary representation, along with comprehensive unit tests covering edge cases like leap years, timezone offsets, and chronological sorting. No review comments were provided, and the implementation looks solid and well-tested, so I have no additional feedback.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6288 +/- ##
==========================================
+ Coverage 96.23% 96.25% +0.01%
==========================================
Files 280 281 +1
Lines 72146 72436 +290
==========================================
+ Hits 69433 69724 +291
+ Misses 2713 2712 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add a standalone temporal codecs module (
routing::temporal) to support SpannerDATEandTIMESTAMPkey column evaluation in location-aware routing. This implementation parses ISO 8601 date strings into days since Unix epoch and RFC 3339 timestamp strings into UTC offset seconds and nanoseconds, converting them into Spanner's ordered binary format (ssformat). The module includes full support for valid Spanner date ranges (0001-01-01to9999-12-31), non-UTC timezone offsets, leap second normalization, and verification of chronological sort order preservation.