jonahgao commented on code in PR #11897:
URL: https://github.com/apache/datafusion/pull/11897#discussion_r1711677343
##########
datafusion/sql/src/select.rs:
##########
@@ -778,9 +777,12 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
// Rewrite the HAVING expression to use the columns produced by the
// aggregation.
let having_expr_post_aggr = if let Some(having_expr) = having_expr_opt
{
- let having_expr_post_aggr =
- rebase_expr(having_expr, &aggr_projection_exprs, input)?;
-
+ let having_expr_post_aggr = match having_expr {
+ Expr::Literal(ScalarValue::Boolean(Some(false))) => {
+ having_expr.to_owned()
Review Comment:
Can it fix for other constant expressions 🤔, such as
```sql
SELECT AVG(v1) FROM t1 GROUP BY 1 != 1 having 1 != 1;
```
Looks like this issue is also related to PushdownFilter.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]