You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "niebayes (via GitHub)" <gi...@apache.org> on 2025/03/10 08:32:19 UTC
[I] Regression: count(*) does not work unless using default expression planners [datafusion]
niebayes opened a new issue, #15114:
URL: https://github.com/apache/datafusion/issues/15114
Previously, the count wildcard is expanded by the CountWildCard analyzer rule which however was removed in the latest release 46.0. And the functionality is now moved to the ExprPlanner for planning aggregate functions, see #14689.
This functionality assumes users could get expression planners from the ContextProvider. See:
https://github.com/apache/datafusion/blob/dfaede0ba5c970a131117cb1c089bb338dc64fb3/datafusion/sql/src/expr/function.rs#L374-L379
It's ok for the DataFusion naive context provider `SessionContextProvider` since it's able to retrieve expression planners from the SessionState. See:
https://github.com/apache/datafusion/blob/dfaede0ba5c970a131117cb1c089bb338dc64fb3/datafusion/core/src/execution/session_state.rs#L1619-L1627
Unfortunately, user defined ContextProvider is unable to get expression planners from the SessionState, since the `expr_planners` field is not exposed.
As a result, users who wish to utilize the default expression planners must import the `FunctionRegistry` trait, which provides an `expr_planners` method, and notably, SessionState implements this trait.
To address this issue, I propose adding a method to SessionState that returns a reference of the registered expression planners. This would provide a more straightforward and consistent way for user-defined ContextProvider implementations to access these planners without requiring additional trait imports.
--
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-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Regression: count(*) does not work unless using default expression planners [datafusion]
Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on issue #15114:
URL: https://github.com/apache/datafusion/issues/15114#issuecomment-2710050072
> I think adding expr_planners to SessionState suffices to this issue. I don't know any other usages that may access expression planners from Session.
Then we can add it to `SessionState` first, adding it to `Session` is easy if we need to
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Regression: count(*) does not work unless using default expression planners [datafusion]
Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on issue #15114:
URL: https://github.com/apache/datafusion/issues/15114#issuecomment-2709816452
`expr_planners` can be a method of `trait Session` similar to `scalar_functions`, `aggregate_functions`.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Regression: count(*) does not work unless using default expression planners [datafusion]
Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on issue #15114:
URL: https://github.com/apache/datafusion/issues/15114#issuecomment-2709963871
The difference is that if you add `expr_planners` to `SessionState` only, you need `SessionState ` which is only accessible in core crate, if you add it to `Session` trait then you can call it in `catalog` crate or others that import `Session`
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Regression: count(*) does not work unless using default expression planners [datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #15114: Regression: count(*) does not work unless using default expression planners
URL: https://github.com/apache/datafusion/issues/15114
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Regression: count(*) does not work unless using default expression planners [datafusion]
Posted by "niebayes (via GitHub)" <gi...@apache.org>.
niebayes commented on issue #15114:
URL: https://github.com/apache/datafusion/issues/15114#issuecomment-2709852008
I'm not sure which one is better, adding an `expr_planners` method to `Session`, or to `SessionState`. I’d appreciate if someone more familiar with the codebase can guide this decision.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Regression: count(*) does not work unless using default expression planners [datafusion]
Posted by "niebayes (via GitHub)" <gi...@apache.org>.
niebayes commented on issue #15114:
URL: https://github.com/apache/datafusion/issues/15114#issuecomment-2710031282
I think adding `expr_planners` to `SessionState` suffices to this issue. I don't any other cases that may access expression planners from `Session`.
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Regression: count(*) does not work unless using default expression planners [datafusion]
Posted by "niebayes (via GitHub)" <gi...@apache.org>.
niebayes commented on issue #15114:
URL: https://github.com/apache/datafusion/issues/15114#issuecomment-2710090681
take
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Regression: count(*) does not work unless using default expression planners [datafusion]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #15114:
URL: https://github.com/apache/datafusion/issues/15114#issuecomment-2713795994
BTW I think we should consider fixing this in a 46.0.0 release.
- Filed https://github.com/apache/datafusion/issues/15151 to track
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org