klion26 commented on code in PR #10114:
URL: https://github.com/apache/arrow-rs/pull/10114#discussion_r3395142504


##########
parquet-variant-compute/src/type_conversion.rs:
##########
@@ -345,3 +441,237 @@ macro_rules! primitive_conversion_single_value {
     }};
 }
 pub(crate) use primitive_conversion_single_value;
+
+#[cfg(test)]
+mod tests {
+    use crate::type_conversion::variant_to_string;
+    use arrow::array::{
+        Array, BooleanArray, Date32Array, Int32Builder, ListBuilder, 
StringArray,
+        Time64MicrosecondArray, TimestampMicrosecondArray, 
TimestampNanosecondArray,
+    };
+    use arrow::compute::cast;
+    use arrow_schema::DataType;
+    use chrono::{DateTime, NaiveDate, NaiveTime};
+    use parquet_variant::{Variant, VariantBuilder, VariantBuilderExt};
+    use std::iter::zip;
+
+    #[test]
+    fn test_compatible_cast_logic_with_cast_kernel() {

Review Comment:
   Some cast logic was implemented directly here, add a test to cover it.



##########
parquet-variant-compute/src/variant_to_arrow.rs:
##########
@@ -793,7 +746,9 @@ macro_rules! define_variant_to_primitive_builder {
                     |$value| $value_transform,
                 ) {
                     Ok(Some(v)) => {
-                        self.builder.append_value(v);
+                        let $builder = &mut self.builder;

Review Comment:
   Add this because that `variant_to_string` return `String` now, but the 
`builder.append_value` receives a `&str`



-- 
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]

Reply via email to