rluvaton commented on code in PR #23430:
URL: https://github.com/apache/datafusion/pull/23430#discussion_r3554656213
##########
datafusion/physical-expr/src/physical_expr.rs:
##########
@@ -404,6 +411,12 @@ mod tests {
assert!(!physical_exprs_equal(&vec1, &vec3));
assert!(!physical_exprs_bag_equal(&vec1, &vec2));
assert!(!physical_exprs_bag_equal(&vec1, &vec3));
+
+ let unknown = Arc::new(UnKnownColumn::new("unknown")) as Arc<dyn
PhysicalExpr>;
+ assert!(!physical_exprs_equal(
+ std::slice::from_ref(&unknown),
+ std::slice::from_ref(&unknown)
+ ));
}
Review Comment:
Why changed?
##########
datafusion/physical-optimizer/src/ensure_requirements/enforce_distribution.rs:
##########
@@ -630,11 +630,10 @@ fn expected_expr_positions(
let mut current = current.to_vec();
for expr in expected.iter() {
// Find the position of the expected expr in the current expressions
- if let Some(expected_position) = current.iter().position(|e|
e.eq(expr)) {
+ {
+ let expected_position = current.iter().position(|e| e.eq(expr))?;
current[expected_position] = Arc::new(NoOp::new());
indexes.push(expected_position);
- } else {
- return None;
}
Review Comment:
Nit: no need for the double closure
--
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]