chenkovsky commented on code in PR #16185: URL: https://github.com/apache/datafusion/pull/16185#discussion_r2111650159
########## datafusion/physical-expr/src/equivalence/class.rs: ########## @@ -422,6 +423,60 @@ impl EquivalenceGroup { self.bridge_classes() } + /// Returns a set of all adjacent expression pairs in this equivalence group. + /// + /// For each equivalence class, this function creates pairs of expressions that are adjacent + /// to each other. For example, if we have an equivalence class [a, b, c], it will generate + /// pairs (a,b), (a,c), (b,c) and their reverse pairs (b,a), (c,a), (c,b). + /// + /// This is used by the `intersect` function to find common expression pairs between + /// two equivalence groups. + #[allow(clippy::type_complexity)] + fn adjacent_set(&self) -> HashSet<(&Arc<dyn PhysicalExpr>, &Arc<dyn PhysicalExpr>)> { + let mut set = HashSet::new(); Review Comment: maybe we can also rewrite remove_redundant_entries, https://github.com/apache/datafusion/compare/main...chenkovsky:datafusion:feature/improve_equivalence -- 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