andygrove commented on PR #2461:
URL:
https://github.com/apache/arrow-datafusion/pull/2461#issuecomment-1119169178
> LGTM - The logic `!group_by_exprs.is_empty() || !aggr_exprs.is_empty()`
seems to allow for `HAVING` clauses if aggregate expressions are present,
however might it be worth adding another test that does have an aggregate and
`HAVING` clause? Could be another simple check in an existing test even.
Yes that's a great point. I checked and there is already a test to cover
this case:
``` rust
#[test]
fn select_aggregate_with_having_that_reuses_aggregate() {
let sql = "SELECT MAX(age)
FROM person
HAVING MAX(age) < 30";
let expected = "Projection: #MAX(person.age)\
\n Filter: #MAX(person.age) < Int64(30)\
\n Aggregate: groupBy=[[]], aggr=[[MAX(#person.age)]]\
\n TableScan: person projection=None";
quick_test(sql, expected);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]