jayzhan211 commented on PR #11229: URL: https://github.com/apache/datafusion/pull/11229#issuecomment-2205306156
I can think of two alternative approaches 1. We can just add `wildcard` to count if we found that args is empty ``` select_exprs: [AggregateFunction(AggregateFunction { func_def: UDF(AggregateUDF { inner: Count { name: "count", signature: Signature { type_signature: VariadicAny, volatility: Immutable } } }), args: [Wildcard { qualifier: None }], distinct: false, filter: None, order_by: None, null_treatment: None })] select_exprs: [AggregateFunction(AggregateFunction { func_def: UDF(AggregateUDF { inner: Count { name: "count", signature: Signature { type_signature: VariadicAny, volatility: Immutable } } }), args: [], distinct: false, filter: None, order_by: None, null_treatment: None })] ``` 2. We could probably do even more, we convert args to const 1 if there is wildcard or is empty, so we don't even need the optimize rule `count_wildcard_rule` I think we could rely on the planner trait we recently added in #11180 , so we can rewrite to expect count with args based on the expression we got in sql parser. @tshauck What do you think? -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org