`rewrite_sort_cols_by_agg_alias` test failing when running `cargo test` on `datafusion-expr`
- Dominant language
- Rust
- Stars
- 9.3k
- Forks
- 2.4k
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 344
Description
### Describe the bug
Running off main:
```sh
cargo test -p datafusion-expr
```
Results in test failure:
```
failures:
---- expr_rewriter::order_by::test::rewrite_sort_cols_by_agg_alias stdout ----
running: 'c1 --> c1 -- column *named* c1 that came out of the projection, (not t.c1)'
running: 'min(c2) --> "min(c2)" -- (column *named* "min(t.c2)"!)'
thread 'expr_rewriter::order_by::test::rewrite_sort_cols_by_agg_alias' (6752418) panicked at datafusion/expr/src/expr_rewriter/order_by.rs:308:13:
assertion `left == right` failed:
input:Sort { expr: AggregateFunction(AggregateFunction { func: AggregateUDF { inner: Min { name: "min", signature: Signature { type_signature: VariadicAny, volatility: Immutable, parameter_names: None } } }, params: AggregateFunctionParams { args: [Column(Column { relation: None, name: "c2" })], distinct: false, filter: None, order_by: [], null_treatment: None } }), asc: true, nulls_first: true }
rewritten:Sort { expr: Column(Column { relation: None, name: "min(t.c2)" }), asc: true, nulls_first: true }
expected:Sort { expr: Column(Column { relation: Some(Bare { table: "min(t" }), name: "c2)" }), asc: true, nulls_first: true }
left: Sort { expr: Column(Column { relation: None, name: "min(t.c2)" }), asc: true, nulls_first: true }
right: Sort { expr: Column(Column { relation: Some(Bare { table: "min(t" }), name: "c2)" }), asc: true, nulls_first: true }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
expr_rewriter::order_by::test::rewrite_sort_cols_by_agg_alias
test result: FAILED. 148 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s
```
Not seeing this when I run `cargo test` however, so not sure what is going on here 🤔
### To Reproduce
_No response_
### Expected behavior
_No response_
### Additional context
_No response_
Contributor guide
Research direction
Start in datafusion/expr/src/expr_rewriter/order_by.rs around line 308 and inspect the rewrite_sort_cols_by_agg_alias test. Run cargo test -p datafusion-expr, then compare the result with cargo test to investigate why the targeted test differs. Done means the test behaves consistently and its rewritten expression matches the expected expression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- data-engineering, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100