junjunjd commented on code in PR #7901:
URL: https://github.com/apache/arrow-datafusion/pull/7901#discussion_r1378373755


##########
datafusion/common/src/scalar.rs:
##########
@@ -330,9 +330,9 @@ impl PartialOrd for ScalarValue {
                         let arr2 = list_arr2.value(i);
 
                         let lt_res =
-                            arrow::compute::kernels::cmp::lt(&arr1, 
&arr2).unwrap();
+                            arrow::compute::kernels::cmp::lt(&arr1, 
&arr2).ok()?;

Review Comment:
   This panic is reachable, for example if `arr1` and `arr2` have different 
data type, 
[`arrow::compute::kernels::cmp::lt`](https://github.com/apache/arrow-rs/blob/master/arrow-ord/src/cmp.rs#L201-L204)
 will panic.
   It makes sense to return `None` here instead of panicking and exiting since 
user just performs a partial order comparison. 
   This does not require any code change in client side.



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