Describe the bug
DataFusion currently supports the HAVING clause in non-aggregate queries, as demonstrated in this test:
#[test]
fn select_with_having() {
let sql = "SELECT id, age
FROM person
HAVING age > 100 AND age < 200";
let expected = "Projection: #person.id, #person.age\
\n Filter: #person.age > Int64(100) AND #person.age < Int64(200)\
\n TableScan: person projection=None";
quick_test(sql, expected);
}
To Reproduce
N/A
Expected behavior
Neither Postgres nor Spark support this use case. We should fail to plan non-aggregate queries that use a HAVING clause.
Additional context
None