-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add metas to PartiQL Common #488
Conversation
This PR - adds `NodeId` to `StaticType`. - makes `AutoNodeIdGenerator` thread-safe - adds `PartiqlShapeBuilder` and moves some `PartiqlShape` APIs to it; this is to be able to generate unique `NodeId`s for a `PartiqlShape` that includes static types that themselves can include other static types. - adds a static thread safe `shape_builder` function that provides a convenient way for using `PartiqlShapeBuilder` for creating new shapes. - prepends existing type macros with `type` such as `type_int!` to make macro names more friendly. - removes `const` PartiQL types under `partiql-types` in favor of `PartiqlShapeBuilder`.
Adds an implementation for storing metadata for PartiQL objects. Currently, the implementation does not include any traits. It introduces `PartiqlMetadata` and `PartiqlMetaValue` structures: ```rust let foo_val = PartiqlMetaValue::String("foo".to_string()); let i64_val = PartiqlMetaValue::Int64(2); let expected_vec_val = vec![foo_val, i64_val]; let expected_bool_val = true; let expected_int_val = 2; let expected_float_val = 2.5; let expected_str_val = "foo"; let mut expected_map = PartiqlMetadata::new(); expected_map.insert("bool value", expected_bool_val.into()); expected_map.insert("integer value", expected_int_val.into()); let mut metas = PartiqlMetadata::new(); metas.insert("vec value", expected_vec_val.clone().into()); metas.insert("bool value", expected_bool_val.into()); metas.insert("integer value", expected_int_val.into()); metas.insert("float value", expected_float_val.into()); metas.insert("string value", expected_str_val.into()); metas.insert("map value", expected_map.clone().into()); let vec_val = metas.vec_value("vec value").expect("vec meta value"); let bool_val = metas.bool_value("bool value").expect("bool meta value"); let int_val = metas.i32_value("integer value").expect("i32 meta value"); let float_val = metas.f64_value("float value").expect("f64 meta value"); let string_val = metas.string_value("string value").expect("string meta value"); let map_val = metas.map_value("map value").expect("map meta value"); assert_eq!(vec_val, expected_vec_val.clone()); assert_eq!(bool_val, expected_bool_val.clone()); assert_eq!(int_val, expected_int_val.clone()); assert_eq!(float_val, expected_float_val.clone()); assert_eq!(string_val, expected_str_val); assert_eq!(map_val, expected_map.clone()); ```
Conformance comparison report
Number passing in both: 5731 Number failing in both: 612 Number passing in Base (7203852) but now fail: 0 Number failing in Base (7203852) but now pass: 0 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #488 +/- ##
==========================================
- Coverage 80.98% 80.61% -0.37%
==========================================
Files 69 70 +1
Lines 18796 18997 +201
Branches 18796 18997 +201
==========================================
+ Hits 15221 15315 +94
- Misses 3131 3238 +107
Partials 444 444 ☔ View full report in Codecov by Sentry. |
Description of changes:
Adds an implementation for storing metadata for PartiQL objects. Currently, the implementation does not include any traits. It introduces
PartiqlMetadata
andPartiqlMetaValue
structures:By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.