Skip to content

Improve summarize result for empty inputs #3640

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

Merged
merged 4 commits into from
Nov 16, 2023

Conversation

jachris
Copy link
Contributor

@jachris jachris commented Nov 14, 2023

If the summarize operator has no by clause, it now returns a result even if there is no input. For example, summarize num=count(.) returns an event with {"num": 0}. Aggregation functions which do not have a single default value, for example because it would depend on the input type, return null.

@jachris jachris added the operator Source, transformation, and sink label Nov 14, 2023
@jachris jachris force-pushed the topic/summarize-empty-input branch 2 times, most recently from 31397e5 to 3668d20 Compare November 14, 2023 16:32
@jachris jachris force-pushed the topic/summarize-empty-input branch from 3668d20 to 884622d Compare November 14, 2023 16:33
@jachris jachris marked this pull request as ready for review November 14, 2023 16:34
@jachris
Copy link
Contributor Author

jachris commented Nov 15, 2023

I also added 220cda3 to make summarize use the proper null_type, now that we have it. I don't think we need a changelog for this.

Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the two fixes. The implementation looks good to me, just one small question.

@jachris jachris enabled auto-merge November 15, 2023 09:59
@dominiklohmann dominiklohmann merged commit 28e93b8 into main Nov 16, 2023
@dominiklohmann dominiklohmann deleted the topic/summarize-empty-input branch November 16, 2023 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
operator Source, transformation, and sink
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants