Skip to content
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

bug: Cannot SUM INTERVAL values #17374

Open
1 of 2 tasks
inviscid opened this issue Jan 27, 2025 · 3 comments · May be fixed by #17379
Open
1 of 2 tasks

bug: Cannot SUM INTERVAL values #17374

inviscid opened this issue Jan 27, 2025 · 3 comments · May be fixed by #17379
Labels
C-bug Category: something isn't working

Comments

@inviscid
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Version

v1.2.680-p3

What's Wrong?

With the addition of the new INTERVAL data type we attempted to sum interval values to obtain a total duration. However, we are getting the following error:

^^^^^^^^^^^^^^^^^^^^^^^^^ sum does not support type 'Interval'

How to Reproduce?

Create a table with an interval column.

Run a SELECT query that applies a SUM to the interval column.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@inviscid inviscid added the C-bug Category: something isn't working label Jan 27, 2025
@TCeason
Copy link
Collaborator

TCeason commented Jan 27, 2025

It's by design. Most databases, including DuckDB, don’t support summing interval types directly. Could you explain a bit more about why you need to sum interval

@rad-pat
Copy link

rad-pat commented Jan 27, 2025

We are transitioning over from Postgres/Greenplum where we were able to sum the intervals. The intervals we have represent a time taken for a delay in process and we have been grouping/summing this by other columns to get total delay by e.g. region.

@inviscid
Copy link
Author

This is also useful for things like tracking different operations in manufacturing or logistics. It is very common to capture the individual durations and then need to provide a total completion duration which is the sum of the parts.

@TCeason TCeason linked a pull request Jan 28, 2025 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants