Lordworms commented on code in PR #9719:
URL: https://github.com/apache/arrow-datafusion/pull/9719#discussion_r1566226630
##########
datafusion/optimizer/src/common_subexpr_eliminate.rs:
##########
@@ -829,6 +849,213 @@ fn replace_common_expr(
.data()
}
+struct ProjectionAdder {
+ // Keeps track of cumulative usage of common expressions with its
corresponding data type.
+ // accross plan where key is unsafe nodes that cumulative tracking is
invalidated.
+ insertion_point_map: HashMap<usize, HashMap<Expr, (DataType, u32)>>,
+ depth: usize,
+ // Keeps track of cumulative usage of the common expressions with its
corresponding data type.
+ // between safe nodes.
+ complex_exprs: HashMap<Expr, (DataType, u32)>,
+}
+pub fn is_not_complex(op: &Operator) -> bool {
+ matches!(
+ op,
+ &Operator::Eq | &Operator::NotEq | &Operator::Lt | &Operator::Gt |
&Operator::And
+ )
+}
+
+impl ProjectionAdder {
+ // TODO: adding more expressions for sub query, currently only support for
Simple Binary Expressions
Review Comment:
I'll add that
--
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]