r4ntix commented on code in PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#discussion_r1217974234
##########
datafusion/optimizer/src/analyzer/count_wildcard_rule.rs:
##########
@@ -97,7 +97,12 @@ fn analyze_internal(plan: LogicalPlan) ->
Result<Transformed<LogicalPlan>> {
fetch,
})))
}
- LogicalPlan::Projection(projection) => {
+ LogicalPlan::Projection(projection)
+ if matches!(
+ projection.input.as_ref(),
+ LogicalPlan::Aggregate(..) | LogicalPlan::Window(..)
+ ) =>
Review Comment:
Other problems can result here, such as:
```shell
DataFusion CLI v25.0.0
❯ with tbl as (SELECT count(a) as "COUNT(*)" from (values (1), (2)) as x(a))
SELECT * from tbl;
Optimizer rule 'push_down_projection' failed
caused by
Internal error: replace column failed. This was likely caused by a bug in
DataFusion's code and we would welcome that you file an bug report in our issue
tracker
```
--
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]