Path: blob/main/crates/polars-plan/src/plans/optimizer/predicate_pushdown/keys.rs
7889 views
//! Keys in the `acc_predicates` hashmap.1use super::*;23// an invisible ascii token we use as delimiter4const HIDDEN_DELIMITER: &str = "\u{1D17A}";56/// Determine the hashmap key by combining all the leaf column names of a predicate7pub(super) fn predicate_to_key(predicate: Node, expr_arena: &Arena<AExpr>) -> PlSmallStr {8let mut iter = aexpr_to_leaf_names_iter(predicate, expr_arena);9if let Some(first) = iter.next() {10if let Some(second) = iter.next() {11let mut new = String::with_capacity(32 * iter.size_hint().0);12new.push_str(first);13new.push_str(HIDDEN_DELIMITER);14new.push_str(second);1516for name in iter {17new.push_str(HIDDEN_DELIMITER);18new.push_str(name);19}20return PlSmallStr::from_string(new);21}22first.clone()23} else {24PlSmallStr::from_str(HIDDEN_DELIMITER)25}26}272829