superserious-dev commented on code in PR #8179:
URL: https://github.com/apache/arrow-rs/pull/8179#discussion_r2305831426
##########
parquet-variant-compute/src/variant_get/mod.rs:
##########
@@ -202,29 +203,95 @@ mod test {
);
}
- /// Shredding: extract a value as a VariantArray
- #[test]
- fn get_variant_shredded_int32_as_variant() {
- let array = shredded_int32_variant_array();
- let options = GetOptions::new();
- let result = variant_get(&array, options).unwrap();
-
- // expect the result is a VariantArray
- let result: &VariantArray = result.as_any().downcast_ref().unwrap();
- assert_eq!(result.len(), 4);
-
- // Expect the values are the same as the original values
- assert_eq!(result.value(0), Variant::Int32(34));
- assert!(!result.is_valid(1));
- assert_eq!(result.value(2), Variant::from("n/a"));
- assert_eq!(result.value(3), Variant::Int32(100));
+ /// Partial Shredding: extract a value as a VariantArray
+ macro_rules! numeric_partially_shredded_test {
+ ($test:ident, $data_fn:ident, $primitive_type:ty) => {
+ #[test]
+ fn $test() {
Review Comment:
Updated. I agree that it looks more readable this way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]