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

Row Hash loads whole aggregation state to memory before sending #3460

Closed
milenkovicm opened this issue Sep 13, 2022 · 0 comments · Fixed by #3461
Closed

Row Hash loads whole aggregation state to memory before sending #3460

milenkovicm opened this issue Sep 13, 2022 · 0 comments · Fixed by #3461
Labels
bug Something isn't working

Comments

@milenkovicm
Copy link
Contributor

Describe the bug

Row Hash aggregation, loads whole aggregation state to memory before sending a single batch downstream. The resulting record batch will have more rows than predefined batch size

problematic part of code https://github.com/milenkovicm/arrow-datafusion/blob/17f069df4227b837cf2741a545c39a8b68d5fd76/datafusion/core/src/physical_plan/aggregates/row_hash.rs#L438
where iterator without limits is crated, and whole state is cloned, which doubles memory needed for the aggregation state.

function poll_next creates single batch https://github.com/milenkovicm/arrow-datafusion/blob/17f069df4227b837cf2741a545c39a8b68d5fd76/datafusion/core/src/physical_plan/aggregates/row_hash.rs#L146

To Reproduce

Run an aggregation

Expected behavior

Resulting aggregation should be chunked according to the predefined batch size

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant