refactor(query): refactor hash join spill
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
Code readability and maintainability
- New step transition mechanism: this PR divides hash join probe/build step into three types:
SyncStep,AsyncStep, andFinish, ensuring that step transition occurs in the event and this PR redesigns step transition to make the step transition logic clearer and improve code readability and maintainability. - Unify
ProbeSpillHandlerandBuildSpillHandlertoHashJoinSpillerto improve code maintainability. - Unify the spill logic of cross join and other types.
- Introduce
HashTableTypeto reduce code.
Bug Fixed
- Fixed a corner case of left-related join when spill happens.
- Left Anti join can't probe first round when spill happens.
Performance
Improved the performance of partition.
Tests
- [ ] TPC-H spill test
- [ ] TPC-DS spill test
- [ ] Wizard join spill test
Tests
- [ ] Unit Test
- [x] Logic Test
- [ ] Benchmark Test
- [ ] No Test - Explain why
Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Breaking Change (fix or feature that could cause existing functionality not to work as expected)
- [ ] Documentation Update
- [x] Refactoring
- [x] Performance Improvement
- [x] Other (please describe): code maintainability
Docker Image for PR
-
tag:
pr-15746-9107967-1717765135
note: this image tag is only available for internal use, please check the internal doc for more details.
Docker Image for PR
-
tag:
pr-15746-61aa91b-1718103773
note: this image tag is only available for internal use, please check the internal doc for more details.
Docker Image for PR
-
tag:
pr-15746-d5f0732-1723784071
note: this image tag is only available for internal use, please check the internal doc for more details.
Docker Image for PR
-
tag:
pr-15746-6e26223-1723829677
note: this image tag is only available for internal use, please check the internal doc for more details.
Docker Image for PR
-
tag:
pr-15746-6e26223-1723831273
note: this image tag is only available for internal use, please check the internal doc for more details.
Docker Image for PR
-
tag:
pr-15746-550a9dc-1724066510
note: this image tag is only available for internal use, please check the internal doc for more details.
Docker Image for PR
-
tag:
pr-15746-7335d28-1724069360
note: this image tag is only available for internal use, please check the internal doc for more details.