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

Issue #8086: Parallel Window Refactoring #8269

Merged
merged 21 commits into from
Jul 18, 2023

Conversation

hawkfish
Copy link
Contributor

@hawkfish hawkfish commented Jul 15, 2023

This PR is mostly code motion for parallel window function computation, but there is concurrent work being done on the EXCLUDE functionality by Romaine that relies on it.

The non-trivial changes are:

  • Make the evaluation of all window function vectors "stateless". Mostly this is straightforward, but DENSE_RANK required care.
  • Extract the reusable state needed to evaluate window functions into thread-local objects. This will enable parallel evaluation of the read-only acceleration structures.

Richard Wesley added 16 commits June 26, 2023 15:20
Basic code motion to refactor WindowExecutor into smarter,
purpose-built subclasses.
`WindowCumeDistExecutor` does not need `NextRank`
Convert rank and dense_rank to compute their state at the start of each block
This will allow them to be called on multiple threads and out of order.
Break out the window executor code into its own files.
Create top-level local state objects for window execution.
This will enable parallel evaluation.
Remove the Compute method as it is vestigial.
Break out windowed aggregation evaluation state from the aggregator.
More code cleanup and naming clarifications.
* Update coverage
* Fix stateless DENSE_RANK setup (another victory for SVS=2)
@hawkfish hawkfish requested review from Mytherin and hannes July 15, 2023 22:30
Copy link
Collaborator

@Mytherin Mytherin 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 PR! Looks great! Unifying everything behind one interface makes everything a lot more clean.

Could we perhaps work on improving the code coverage while we're at it? A lot of these uncovered lines in window_executor.cpp are likely inherited from the previous implementation, but it might be worthwhile to have a look at covering them. Particularly those in the WindowDenseRankExecutor

src/execution/window_executor.cpp Show resolved Hide resolved
src/execution/window_executor.cpp Show resolved Hide resolved
src/execution/window_executor.cpp Show resolved Hide resolved
src/execution/window_executor.cpp Show resolved Hide resolved
src/execution/window_executor.cpp Show resolved Hide resolved
src/execution/window_executor.cpp Show resolved Hide resolved
@github-actions github-actions bot marked this pull request as draft July 17, 2023 15:26
@hawkfish hawkfish marked this pull request as ready for review July 17, 2023 17:18
@Mytherin Mytherin merged commit b1ae312 into duckdb:master Jul 18, 2023
53 checks passed
@Mytherin
Copy link
Collaborator

Thanks! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants