diff --git a/client-spark/common/src/main/java/org/apache/spark/shuffle/reader/RssShuffleDataIterator.java b/client-spark/common/src/main/java/org/apache/spark/shuffle/reader/RssShuffleDataIterator.java index 478460bc38..c905d27c66 100644 --- a/client-spark/common/src/main/java/org/apache/spark/shuffle/reader/RssShuffleDataIterator.java +++ b/client-spark/common/src/main/java/org/apache/spark/shuffle/reader/RssShuffleDataIterator.java @@ -158,8 +158,8 @@ private int uncompress(CompressedShuffleBlock rawBlock, ByteBuffer rawData) { unCompressedBytesLength += uncompressedLen; long decompressDuration = System.currentTimeMillis() - startDecompress; decompressTime += decompressDuration; - // ByteBuffer's limit may not uncompressDataLength after using compress method. - // So we need set limit here. + // uncompressedData's limit is not updated by `codec.decompress`, however this information is used + // by `createKVIterator`. Update limit here. uncompressedData.limit(uncompressedData.position() + uncompressedLen); } else { uncompressedData = rawData;