-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for AVG(Timestamp) types #200
Comments
Comment from Andrew Lamb(alamb) @ 2021-04-11T09:48:09.161+0000: [~Dandandan] notes that PostgreSQL doesn't support SUM or AVG for timestamps: https://www.postgresql.org/docs/13/functions-aggregate.html so perhaps we should not support it in DataFusion either :thinking_face: |
Postgresql has Should we close this and submit another ticket for |
@waitingkuo -- I think that sounds like a good idea. I will do so. |
@alamb i just tested postgrseql, looks like SUM and AVG cast Time to Interval and then SUM / AVG them willy=# select pg_typeof(SUM(time '00:00:00')), pg_typeof(AVg(time '00:00:00'));
pg_typeof | pg_typeof
-----------+-----------
interval | interval
(1 row) this make sense otherwise SUM(Time) is just quite strange |
#3166 👍 |
Note: migrated from original JIRA: https://issues.apache.org/jira/browse/ARROW-12318
This is a follow on to ARROW-12277
Background: Support for Min/Max/Sum/Count were added for DataType::Timestamp(*) types in apache/arrow#9970.
This ticket tracks adding support for Avg, which is slightly more involved as currently Avg assumes the output type is always F64, and in this case I think Avg(timestamp) should also be (timestamp). We should double check what postgres does in this case and follow its example
The text was updated successfully, but these errors were encountered: