liamzwbao commented on code in PR #8233:
URL: https://github.com/apache/arrow-rs/pull/8233#discussion_r2305907429
##########
parquet-variant-compute/src/type_conversion.rs:
##########
@@ -20,6 +20,7 @@
/// Convert the input array to a `VariantArray` row by row, using `method`
/// not requiring a generic type to downcast the generic array to a specific
/// array type and `cast_fn` to transform each element to a type compatible
with Variant
+/// If `strict` is true, return error on conversion failure. If false, insert
null.
Review Comment:
Maybe also worth mentioning that `strict` defaults to `true` when not
specified.
##########
parquet-variant-compute/src/cast_to_variant.rs:
##########
@@ -51,67 +51,147 @@ fn convert_timestamp(
time_zone: &Option<Arc<str>>,
input: &dyn Array,
builder: &mut VariantArrayBuilder,
-) {
+ strict: bool,
+) -> Result<(), ArrowError> {
Review Comment:
The logic for these four types looks quite similar other than the downcast
type. Could we refactor them into a generic function?
##########
parquet-variant-compute/src/type_conversion.rs:
##########
@@ -52,6 +78,7 @@ pub(crate) use non_generic_conversion_single_value;
/// Convert the input array to a `VariantArray` row by row, using `method`
/// requiring a generic type to downcast the generic array to a specific
/// array type and `cast_fn` to transform each element to a type compatible
with Variant
+/// If `strict` is true, return error on conversion failure. If false, insert
null.
Review Comment:
ditto
--
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]