qijiale76 opened a new pull request, #1666:
URL: https://github.com/apache/incubator-uniffle/pull/1666
<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
Examples:
- "[#123] feat(operator): support xxx"
- "[#233] fix: check null before access result in xxx"
- "[MINOR] refactor: fix typo in variable name"
- "[MINOR] docs: fix typo in README"
- "[#255] test: fix flaky test NameOfTheTest"
Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. Contributor guidelines:
https://github.com/apache/incubator-uniffle/blob/master/CONTRIBUTING.md
3. If the PR is unfinished, please mark this PR as draft.
-->
### What changes were proposed in this pull request?
The current implementation of the SortBufferIterator.getKey() and
.getValue() methods in the SortWriteBuffer class assumes that keys and values
are always stored within a single buffer. This assumption can lead to runtime
exceptions, specifically ArrayIndexOutOfBoundsException, when keys or values
span multiple WrappedBuffer instances.
This PR update getKey() to use fetchDataFromBuffers() to retrieve the key
data. And this PR update getValue() to first adjust the starting index and
offset based on the length of the key and then use fetchDataFromBuffers() to
retrieve the value data.
### Why are the changes needed?
Fix: #1341
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Tested manually. I'll submit a new integration test later.
--
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]