adriangb commented on code in PR #18735:
URL: https://github.com/apache/datafusion/pull/18735#discussion_r2530153580
##########
datafusion/physical-expr-common/src/datum.rs:
##########
@@ -99,29 +99,27 @@ pub fn apply_cmp_for_nested(
let left_data_type = lhs.data_type();
let right_data_type = rhs.data_type();
- if matches!(
- op,
- Operator::Eq
- | Operator::NotEq
- | Operator::Lt
- | Operator::Gt
- | Operator::LtEq
- | Operator::GtEq
- | Operator::IsDistinctFrom
- | Operator::IsNotDistinctFrom
- ) && left_data_type.equals_datatype(&right_data_type)
- {
- apply(lhs, rhs, |l, r| {
- Ok(Arc::new(compare_op_for_nested(op, l, r)?))
- })
- } else {
- internal_err!(
- "invalid operator or data type mismatch for nested data, op {}
left {}, right {}",
+ assert_or_internal_err!(
+ matches!(
op,
- left_data_type,
- right_data_type
- )
- }
+ Operator::Eq
+ | Operator::NotEq
+ | Operator::Lt
+ | Operator::Gt
+ | Operator::LtEq
+ | Operator::GtEq
+ | Operator::IsDistinctFrom
+ | Operator::IsNotDistinctFrom
+ ) && left_data_type.equals_datatype(&right_data_type),
+ "invalid operator or data type mismatch for nested data, op {} left
{}, right {}",
+ op,
+ left_data_type,
+ right_data_type
Review Comment:
```suggestion
"invalid operator or data type mismatch for nested data, op {op}
left {left_data_type}, right {right_data_type}",
```
Does this work?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]