gszadovszky commented on code in PR #1292:
URL: https://github.com/apache/parquet-mr/pull/1292#discussion_r1514751807
##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/DirectCodecFactory.java:
##########
@@ -150,27 +151,25 @@ private IndirectDecompressor(Decompressor decompressor) {
}
@Override
- public BytesInput decompress(BytesInput bytes, int uncompressedSize)
throws IOException {
+ public BytesInput decompress(BytesInput bytes, int decompressedSize)
throws IOException {
decompressor.reset();
byte[] inputBytes = bytes.toByteArray();
decompressor.setInput(inputBytes, 0, inputBytes.length);
- byte[] output = new byte[uncompressedSize];
- decompressor.decompress(output, 0, uncompressedSize);
+ byte[] output = new byte[decompressedSize];
+ decompressor.decompress(output, 0, decompressedSize);
return BytesInput.from(output);
}
@Override
- public void decompress(ByteBuffer input, int compressedSize, ByteBuffer
output, int uncompressedSize)
+ public void decompress(ByteBuffer input, int compressedSize, ByteBuffer
output, int decompressedSize)
throws IOException {
decompressor.reset();
byte[] inputBytes = new byte[compressedSize];
- input.position(0);
Review Comment:
The decompress method with the ByteBuffers is only used at the places where
I've removed the "hacky" comments. There, the buffers positions are 0, so
doesn't really matter.
Before implementing those code parts (#1008), parquet-mr did not use this
API and this is not released yet, so we do not have legacy code depending on it.
It might happen that this API was used outside of parquet-mr but since the
contract was not defined previously and was actually implemented in an
inconsistent way, I would not consider it as a breaking change.
--
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]