chore(spanner): implement key_recipe routing engine for basic types - #6281
chore(spanner): implement key_recipe routing engine for basic types#6281olavloite wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a key recipe evaluation engine for Spanner location-aware routing, enabling the encoding of KeyRecipe specifications into lexicographical binary keys, along with unit and golden conformance tests. It also refactors composite tag validation in ssformat.rs to use u32 instead of i32. The review feedback identifies a correctness issue in the golden tests' byte unescaping logic where casting char to u8 can truncate non-ASCII characters, and suggests applying the 'Return Early' style guide principle in check_supported_key_type and encode_bytes_part to reduce nesting.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6281 +/- ##
==========================================
+ Coverage 96.24% 96.27% +0.02%
==========================================
Files 280 281 +1
Lines 72146 72767 +621
==========================================
+ Hits 69440 70058 +618
- Misses 2706 2709 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c6486aa to
8b69c57
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a key recipe evaluation engine for Spanner location-aware routing, implementing key encoding from a KeyRecipe and column values, along with extensive unit and golden conformance tests. It also updates composite tag constants and validation in ssformat.rs to use u32 instead of i32. The review feedback suggests enhancing transactional safety in encode_key_from_recipe_into by truncating the buffer on error, and refactoring check_supported_key_type and encode_part to return and use &TypeCode directly to avoid redundant lookups.
Add `key_recipe` location-aware routing engine (`encode_key_from_recipe` and `encode_key_from_recipe_into`) to generate binary storage specification keys (`ssformat`) from Spanner `KeyRecipe` metadata for location-aware routing.
8b69c57 to
d9f6f45
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a key recipe evaluation engine for Spanner location-aware routing. It adds key_recipe.rs to evaluate and encode KeyRecipe instances into lexicographical binary keys, along with a comprehensive suite of unit tests and golden conformance tests in golden_tests.rs. Additionally, it updates composite tag validation constants and the append_composite_tag function in ssformat.rs to use u32 instead of i32. I have no further feedback to provide.
Add
key_recipelocation-aware routing engine (encode_key_from_recipeandencode_key_from_recipe_into) to generate binary storage specification keys (ssformat) from SpannerKeyRecipemetadata for location-aware routing.