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

Introduce a SUM0 Aggregate #259

Closed
jacques-n opened this issue Jul 25, 2022 · 4 comments
Closed

Introduce a SUM0 Aggregate #259

jacques-n opened this issue Jul 25, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted No one is currently implementing but it seems like a good idea

Comments

@jacques-n
Copy link
Contributor

SUM0 is an aggregate that behaves the same as Sum in all cases except when no values are added to the sum. In SUM, the output is null. In SUM0, the output is zero.

@jacques-n
Copy link
Contributor Author

This came up while discussing #255 .

@julianhyde
Copy link

+1 I made the same point in #262 before I saw this issue.

@jacques-n
Copy link
Contributor Author

Note that I believe @cpcloud said this was called total in Postgres. That seems better than using the internal Calcite name. Are there other common names for this function in databases or dataframes? No strong opinion from my side but would be good to be as consistent with prior art as possible.

@jvanstraten
Copy link
Contributor

I prefer sum0; total feels like something much more generic than a sum to me. But maybe that's just me.

@westonpace westonpace added enhancement New feature or request good first issue Good for newcomers help wanted No one is currently implementing but it seems like a good idea labels Mar 1, 2023
@vibhatha vibhatha self-assigned this Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted No one is currently implementing but it seems like a good idea
Projects
None yet
Development

No branches or pull requests

5 participants