alamb commented on code in PR #14821: URL: https://github.com/apache/datafusion/pull/14821#discussion_r1973381337
########## datafusion/physical-expr/src/equivalence/class.rs: ########## @@ -216,6 +216,17 @@ pub fn const_exprs_contains( .any(|const_expr| const_expr.expr.eq(expr)) } +/// Checks whether `expr` is among in the uniform `const_exprs`. +pub fn uniform_const_exprs_contains( + const_exprs: &[ConstExpr], + expr: &Arc<dyn PhysicalExpr>, +) -> bool { + const_exprs.iter().any(|const_expr| { + const_expr.expr.eq(expr) + && const_expr.across_partitions() != AcrossPartitions::Heterogeneous Review Comment: I would find this code more explicit it it checked for `== AcrossPartitions::Uniform` rather than `!= Heterogenious` -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org