klion26 commented on code in PR #8825:
URL: https://github.com/apache/arrow-rs/pull/8825#discussion_r2533010768
##########
parquet-variant-compute/src/variant_get.rs:
##########
@@ -1039,6 +1040,43 @@ mod test {
arrow::array::NullArray::new(3)
);
+
perfectly_shredded_variant_array_fn!(perfectly_shredded_null_variant_array_with_int,
|| {
+ Int32Array::from(vec![Some(32), Some(64), Some(48)])
+ });
+
+ // We append null values if type miss match happens in safe mode
+ perfectly_shredded_to_arrow_primitive_test!(
+ get_variant_perfectly_shredded_null_with_type_missmatch_in_safe_mode,
+ DataType::Null,
+ perfectly_shredded_null_variant_array_with_int,
+ arrow::array::NullArray::new(3)
+ );
+
+ // We'll return an error if type miss match happens in strict mode
+ #[test]
+ fn
get_variant_perfectly_shredded_null_as_null_with_type_missmatch_in_strict_mode()
{
+ let array = perfectly_shredded_null_variant_array_with_int();
+ let field = Field::new("typed_value", DataType::Null, true);
+ let options = GetOptions::new()
+ .with_as_type(Some(FieldRef::from(field)))
+ .with_cast_options(CastOptions {
Review Comment:
We use `arrow::compute::CastOptions` in `variant_get` and
`crate::CastOptions` in `cast_to_variant_with_options`, not sure if we need to
unify these in the future.
--
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]