Skip to content

Commit

Permalink
fix(9870): common expression elimination optimization, should always …
Browse files Browse the repository at this point in the history
…re-find the correct expression during re-write. (#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
  • Loading branch information
wiedld authored and andygrove committed Mar 31, 2024
1 parent 799be5e commit 1fa25ae
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 292 deletions.
2 changes: 1 addition & 1 deletion datafusion/expr/src/logical_plan/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2368,7 +2368,7 @@ impl DistinctOn {

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

0 comments on commit 1fa25ae

Please sign in to comment.