Skip to content

Commit cd7a00b

Browse files
authored
fix(9870): common expression elimination optimization, should always re-find the correct expression during re-write. (apache#9871)
* test(9870): reproducer of error with jumping traversal patterns in common-expr-elimination traversals * refactor: remove the IdArray ordered idx, since the idx ordering does not always stay in sync with the updated TreeNode traversal * refactor: use the only reproducible key (expr_identifer) for expr_set, while keeping the (stack-popped) symbol used for alias. * refactor: encapsulate most of the logic within ExprSet, and delineate the expr_identifier from the alias symbol * test(9870): demonstrate that the sqllogictests are now passing
1 parent a23f507 commit cd7a00b

File tree

3 files changed

+214
-292
lines changed

3 files changed

+214
-292
lines changed

datafusion/expr/src/logical_plan/plan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2389,7 +2389,7 @@ impl DistinctOn {
23892389

23902390
/// Aggregates its input based on a set of grouping and aggregate
23912391
/// expressions (e.g. SUM).
2392-
#[derive(Clone, PartialEq, Eq, Hash)]
2392+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
23932393
// mark non_exhaustive to encourage use of try_new/new()
23942394
#[non_exhaustive]
23952395
pub struct Aggregate {

0 commit comments

Comments
 (0)