vishalkotak commented on code in PR #27742:
URL: https://github.com/apache/datafusion/pull/27742#discussion_r4703134806
##########
datafusion/optimizer/src/simplify_expressions/simplify_predicates.rs:
##########
@@ -238,6 +253,24 @@ fn simplify_conjunction(predicates: Vec<Expr>) ->
Result<Vec<Expr>> {
Ok(result)
}
+/// A predicate kept as is, or the place of a column's simplified predicates.
+enum Slot {
+ Other(Expr),
+ Column(Column),
+}
+
+fn push_column_predicate(
+ column_predicates: &mut BTreeMap<Column, Vec<Expr>>,
+ slots: &mut Vec<Slot>,
+ col: Column,
+ predicate: Expr,
+) {
+ if !column_predicates.contains_key(&col) {
+ slots.push(Slot::Column(col.clone()));
+ }
+ column_predicates.entry(col).or_default().push(predicate);
+}
Review Comment:
Done, that's simpler. Thank you.
--
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]