Skip to content

Re-implement DistinctCombineOperator to utilize more threads to merge#14714

Closed
Jackie-Jiang wants to merge 1 commit intoapache:masterfrom
Jackie-Jiang:distinct_merge
Closed

Re-implement DistinctCombineOperator to utilize more threads to merge#14714
Jackie-Jiang wants to merge 1 commit intoapache:masterfrom
Jackie-Jiang:distinct_merge

Conversation

@Jackie-Jiang
Copy link
Copy Markdown
Contributor

On top of #14701

The combine algorithm is as following:

Use an atomic reference as the swap space to merge the results blocks.

  • If the swap space is null, put the new results block in it.
  • If the swap space is not null, take the results block from the swap space, and merge it with the new results block.

Repeat this process until successfully put the new results block in the swap space.
After all threads are done, the results block in the swap space is the final merged results block.

@Jackie-Jiang Jackie-Jiang added enhancement Improvement to existing functionality query Related to query processing labels Dec 25, 2024
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 25, 2024

Codecov Report

❌ Patch coverage is 69.81132% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.89%. Comparing base (59551e4) to head (10410e4).
⚠️ Report is 3870 commits behind head on master.

Files with missing lines Patch % Lines
...core/operator/combine/DistinctCombineOperator.java 69.81% 11 Missing and 5 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14714      +/-   ##
============================================
+ Coverage     61.75%   63.89%   +2.14%     
- Complexity      207     1609    +1402     
============================================
  Files          2436     2703     +267     
  Lines        133233   150729   +17496     
  Branches      20636    23282    +2646     
============================================
+ Hits          82274    96308   +14034     
- Misses        44911    47228    +2317     
- Partials       6048     7193    +1145     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 63.77% <69.81%> (+2.06%) ⬆️
java-21 63.74% <69.81%> (+2.11%) ⬆️
skip-bytebuffers-false 63.84% <69.81%> (+2.09%) ⬆️
skip-bytebuffers-true 63.70% <69.81%> (+35.98%) ⬆️
temurin 63.89% <69.81%> (+2.14%) ⬆️
unittests 63.89% <69.81%> (+2.14%) ⬆️
unittests1 56.24% <69.81%> (+9.35%) ⬆️
unittests2 34.23% <0.00%> (+6.50%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

// Use the atomic reference as the swap space to merge the results blocks. If the swap space is null, put the new
// results block in it. If the swap space is not null, take the results block from the swap space, and merge it
// with the new results block. Repeat this process until successfully put the new results block in the swap space.
// After all threads are done, the results block in the swap space is the final merged results block.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not sure how does this help utilize more threads. Can you elaborate ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This allows all threads to perform the merge. In the old algorithm, the merge is done by a single thread.

@xiangfu0
Copy link
Copy Markdown
Contributor

xiangfu0 commented Apr 6, 2026

Close stale PR, please either rebase and get this PR merged or create a new one.

@xiangfu0 xiangfu0 closed this Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement to existing functionality query Related to query processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants