From 5b749c4816c80e1cd762182b7e1f1fa94ee02dab Mon Sep 17 00:00:00 2001 From: Peter Toth Date: Mon, 21 Oct 2024 22:04:35 +0200 Subject: [PATCH] fix docs, fix `ScalarFunctionExpr::hash_node()` --- datafusion/common/src/cse.rs | 7 ++++--- datafusion/physical-expr/src/scalar_function.rs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/datafusion/common/src/cse.rs b/datafusion/common/src/cse.rs index ff447d8e92070..6555d39324222 100644 --- a/datafusion/common/src/cse.rs +++ b/datafusion/common/src/cse.rs @@ -121,11 +121,12 @@ impl<'n, N: HashNode> Identifier<'n, N> { type IdArray<'n, N> = Vec<(usize, Option>)>; /// A map that contains the number of normal and conditional occurrences of [`TreeNode`]s -/// by their identifiers. +/// by their identifiers. It also contains the position of a [`TreeNode`] in +/// [`CommonNodes`] once a node is found to be common and got extracted. type NodeStats<'n, N> = HashMap, (usize, usize, Option)>; -/// A map that contains the common [`TreeNode`]s and their alias by their identifiers, -/// extracted during the second, rewriting traversal. +/// A list that contains the common [`TreeNode`]s and their alias, extracted during the +/// second, rewriting traversal. type CommonNodes<'n, N> = Vec<(N, String)>; type ChildrenList = (Vec, Vec); diff --git a/datafusion/physical-expr/src/scalar_function.rs b/datafusion/physical-expr/src/scalar_function.rs index d8b5051b705d1..d0d3cb7ea3ce0 100644 --- a/datafusion/physical-expr/src/scalar_function.rs +++ b/datafusion/physical-expr/src/scalar_function.rs @@ -223,7 +223,7 @@ impl HashNode for ScalarFunctionExpr { self.name.hash(state); self.return_type.hash(state); self.nullable.hash(state); - // Add `self.fun` when hash is available + self.fun.hash(state); } }