waynexia commented on issue #7765:
URL: 
https://github.com/apache/arrow-datafusion/issues/7765#issuecomment-1751686327

   >Concretely, what would be the equivalent to the following?
   
   That's the point 👍 For `select * from table` we can simply omit the 
projection. But this doesn't work for `count(*)`. I was thinking about letting 
"nothing" to represent the wildcard, similar to 
[pandas](https://pandas.pydata.org/docs/reference/api/pandas.core.groupby.DataFrameGroupBy.count.html)
 or 
[substrait](https://substrait.io/extensions/functions_aggregate_generic/#count_1).
 But this is a little bad as we have to use `Option<Expr>` instead of overload 
`count()`. An alternative is to add a specific `count()` variant for 
`count(*)`, like `count_all()`. But whatever this API looks like, we must 
change the outer usage because the schema is unavailable for an independent 
`count()` method. `Wildcard` helps to postpone the expanding, and we have to do 
it immediately if it's removed.
   
   The lucky thing is `Expr::Wildcard` is not that generic. So we only handle a 
few cases about it (or maybe the `count(*)` is the only case? I have this 
feeling but I am not sure about it).
   
   >BTW maybe we could improve the situation by adding more documentation to 
the Expr::Wildcard
   
   Makes sense, I'll add it first.


-- 
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]

Reply via email to