jonahgao commented on code in PR #11340:
URL: https://github.com/apache/datafusion/pull/11340#discussion_r1669909386
##########
datafusion/optimizer/src/common_subexpr_eliminate.rs:
##########
@@ -344,12 +344,10 @@ impl CommonSubexprEliminate {
self.try_unary_plan(expr, input, config)?
.transform_data(|(mut new_expr, new_input)| {
assert_eq!(new_expr.len(), 1); // passed in vec![predicate]
- let new_predicate = new_expr
- .pop()
- .unwrap()
- .unalias_nested()
- .update_data(|new_predicate| (new_predicate, new_input));
- Ok(new_predicate)
+ let new_predicate = new_expr.pop().unwrap();
+ // the closure didn't transform the expr, but will be
Review Comment:
Is it possible to remove `transform_data`?
```rust
self.try_unary_plan(expr, input, config)?
.map_data(|(mut new_expr, new_input)| {
assert_eq!(new_expr.len(), 1); // passed in vec![predicate]
let new_predicate = new_expr.pop().unwrap();
Filter::try_new(new_predicate, Arc::new(new_input))
.map(LogicalPlan::Filter)
})
```
--
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]