BiteTheDDDDt opened a new pull request, #58175:
URL: https://github.com/apache/doris/pull/58175
### What problem does this PR solve?
This pull request refactors the logic for sending data blocks to exchange
channels in the `ExchangeSinkOperatorX::sink` method, improving code
maintainability and reducing duplication. The main change is the introduction
of a reusable lambda function to handle sending blocks to the current channel,
which is now used in multiple partitioning scenarios.
**Code refactoring for channel block sending logic:**
* Introduced a lambda function `send_to_current_channel` that encapsulates
the logic for selecting the current channel and sending a block, handling both
local and remote channels, and checking for receiver EOF.
**Application of the new lambda in partitioning cases:**
* Replaced duplicated channel selection and block sending code in the
`RANDOM` partitioning case with a call to `send_to_current_channel`,
simplifying the code and ensuring consistent behavior.
* Replaced duplicated channel selection and block sending code in the
`HIVE_TABLE_SINK_UNPARTITIONED` partitioning case with a call to
`send_to_current_channel`, further reducing code repetition.
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]