Skip to content

Commit

Permalink
remove expression tree hashing as no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-toth committed Jul 11, 2024
1 parent dad557c commit 17f33f7
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions datafusion/optimizer/src/common_subexpr_eliminate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@ struct Identifier<'n> {
}

impl<'n> Identifier<'n> {
fn new(expr: &'n Expr, is_tree: bool, random_state: &RandomState) -> Self {
fn new(expr: &'n Expr, random_state: &RandomState) -> Self {
let mut hasher = random_state.build_hasher();
if is_tree {
expr.hash(&mut hasher);
} else {
expr.hash_node(&mut hasher);
}
expr.hash_node(&mut hasher);
let hash = hasher.finish();
Self { hash, expr }
}
Expand Down Expand Up @@ -1044,8 +1040,7 @@ impl<'n> TreeNodeVisitor<'n> for ExprIdentifierVisitor<'_, 'n> {
fn f_up(&mut self, expr: &'n Expr) -> Result<TreeNodeRecursion> {
let (down_index, sub_expr_id, sub_expr_is_valid) = self.pop_enter_mark();

let expr_id =
Identifier::new(expr, false, self.random_state).combine(sub_expr_id);
let expr_id = Identifier::new(expr, self.random_state).combine(sub_expr_id);
let is_valid = !expr.is_volatile_node() && sub_expr_is_valid;

self.id_array[down_index].0 = self.up_index;
Expand Down

0 comments on commit 17f33f7

Please sign in to comment.