jayzhan211 commented on code in PR #8902:
URL: https://github.com/apache/arrow-datafusion/pull/8902#discussion_r1461303463


##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -104,23 +105,40 @@ fn get_valid_types(
         let elem_base_type = datafusion_common::utils::base_type(elem_type);
         let new_base_type = comparison_coercion(&array_base_type, 
&elem_base_type);
 
-        if new_base_type.is_none() {
-            return internal_err!(
+        let new_base_type = new_base_type.ok_or_else(|| {
+            internal_datafusion_err!(
                 "Coercion from {array_base_type:?} to {elem_base_type:?} not 
supported."
-            );
-        }
-        let new_base_type = new_base_type.unwrap();
+            )
+        })?;
 
         let array_type = 
datafusion_common::utils::coerced_type_with_base_type_only(
             array_type,
             &new_base_type,
         );
 
+        // type coercion for nested FixedSizeList
+        let elem_type = 
datafusion_common::utils::coerced_type_with_base_type_only(

Review Comment:
   elem should not be non-list type. Maybe you are using incorrect signature 
for ArrayAndArray case?



##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -104,23 +105,40 @@ fn get_valid_types(
         let elem_base_type = datafusion_common::utils::base_type(elem_type);
         let new_base_type = comparison_coercion(&array_base_type, 
&elem_base_type);
 
-        if new_base_type.is_none() {
-            return internal_err!(
+        let new_base_type = new_base_type.ok_or_else(|| {
+            internal_datafusion_err!(
                 "Coercion from {array_base_type:?} to {elem_base_type:?} not 
supported."
-            );
-        }
-        let new_base_type = new_base_type.unwrap();
+            )
+        })?;
 
         let array_type = 
datafusion_common::utils::coerced_type_with_base_type_only(
             array_type,
             &new_base_type,
         );
 
+        // type coercion for nested FixedSizeList
+        let elem_type = 
datafusion_common::utils::coerced_type_with_base_type_only(

Review Comment:
   elem should be non-list type. Maybe you are using incorrect signature for 
ArrayAndArray case?



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