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

Fix window aggregate result for empty frames #6872

Closed
wants to merge 1 commit into from

Conversation

pramodsatya
Copy link
Contributor

@pramodsatya pramodsatya commented Oct 3, 2023

Presto returns the default value of the aggregate for rows with empty frames. Velox like DuckDB always returned nulls. Fix Velox behavior to be consistent with Presto.

The default value of aggregates is usually null, but there are aggregates like count which return 0.

Resolves #6416

@netlify
Copy link

netlify bot commented Oct 3, 2023

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 8879104
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/6530b10b3388f4000885e450

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 3, 2023
velox/exec/AggregateWindow.cpp Outdated Show resolved Hide resolved
velox/exec/AggregateWindow.cpp Outdated Show resolved Hide resolved
velox/exec/AggregateWindow.cpp Outdated Show resolved Hide resolved
velox/exec/WindowFunction.cpp Outdated Show resolved Hide resolved
velox/exec/AggregateWindow.cpp Show resolved Hide resolved
velox/exec/AggregateWindow.cpp Outdated Show resolved Hide resolved
velox/exec/AggregateWindow.cpp Outdated Show resolved Hide resolved
velox/exec/AggregateWindow.cpp Show resolved Hide resolved
velox/exec/AggregateWindow.cpp Outdated Show resolved Hide resolved
velox/exec/AggregateWindow.cpp Outdated Show resolved Hide resolved
@pramodsatya pramodsatya force-pushed the window_agg branch 3 times, most recently from 70d3458 to 7c6225a Compare October 12, 2023 21:54
@pramodsatya pramodsatya force-pushed the window_agg branch 2 times, most recently from 418329f to b48d06f Compare October 18, 2023 17:48
Copy link
Collaborator

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

Thanks @pramodsatya

Copy link
Contributor

@mbasmanova mbasmanova left a comment

Choose a reason for hiding this comment

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

Thanks.

velox/exec/WindowFunction.cpp Outdated Show resolved Hide resolved
velox/exec/WindowFunction.h Show resolved Hide resolved
Copy link
Contributor Author

@pramodsatya pramodsatya 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 feedback @mbasmanova, addressed the comments.

velox/exec/WindowFunction.cpp Outdated Show resolved Hide resolved
velox/exec/WindowFunction.h Outdated Show resolved Hide resolved
velox/exec/WindowFunction.h Show resolved Hide resolved
@facebook-github-bot
Copy link
Contributor

@mbasmanova has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@mbasmanova
Copy link
Contributor

@pramodsatya Got a lint warning:

Screenshot 2023-10-19 at 12 11 56 AM

@pramodsatya
Copy link
Contributor Author

@pramodsatya Got a lint warning:

Screenshot 2023-10-19 at 12 11 56 AM

Fixed, thanks for sharing @mbasmanova

@facebook-github-bot
Copy link
Contributor

@mbasmanova has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@conbench-facebook
Copy link

Conbench analyzed the 1 benchmark run on commit 560b0275.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

@facebook-github-bot
Copy link
Contributor

@mbasmanova merged this pull request in 560b027.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aggregate Window Function Semantics Diff: For Empty Frame, Presto return default value, Velox return null
4 participants