Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[java]deconpression in Lz4CompressionCodec.java does not set writer index #38725

Closed
lxyhcx opened this issue Nov 15, 2023 · 0 comments · Fixed by #38840
Closed

[java]deconpression in Lz4CompressionCodec.java does not set writer index #38725

lxyhcx opened this issue Nov 15, 2023 · 0 comments · Fixed by #38840

Comments

@lxyhcx
Copy link

lxyhcx commented Nov 15, 2023

Describe the bug, including details regarding any error messages, version, and platform.

byte[] outBytes = out.toByteArray();
ArrowBuf decompressedBuffer = allocator.buffer(outBytes.length);
decompressedBuffer.setBytes(/*index=*/0, outBytes);
return decompressedBuffer;
}

decompressedBuffer should set writer Index before return it(just like zstd). Or the caller can not get decompressed buffer size.
It can be implemented by
decompressedBuffer.writerIndex(decompressedLength);
or
decompressedBuffer.writerIndex(outBytes.length);

Component(s)

Java

lidavidm pushed a commit that referenced this issue Dec 21, 2023
…et writer index (#38840)

### Rationale for this change

The `doDecompress` function in `Lz4CompressionCodec` misses writing the index when it is compared with the functionality in `ZstdCompressionCodec`. This PR fixes that issue. 

### What changes are included in this PR?

Writes the index for the decompressed ArrowBuf. 

### Are these changes tested?

No

### Are there any user-facing changes?

No
* Closes: #38725

Lead-authored-by: Vibhatha Lakmal Abeykoon <vibhatha@gmail.com>
Co-authored-by: vibhatha <vibhatha@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
@lidavidm lidavidm added this to the 15.0.0 milestone Dec 21, 2023
clayburn pushed a commit to clayburn/arrow that referenced this issue Jan 23, 2024
… not set writer index (apache#38840)

### Rationale for this change

The `doDecompress` function in `Lz4CompressionCodec` misses writing the index when it is compared with the functionality in `ZstdCompressionCodec`. This PR fixes that issue. 

### What changes are included in this PR?

Writes the index for the decompressed ArrowBuf. 

### Are these changes tested?

No

### Are there any user-facing changes?

No
* Closes: apache#38725

Lead-authored-by: Vibhatha Lakmal Abeykoon <vibhatha@gmail.com>
Co-authored-by: vibhatha <vibhatha@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
dgreiss pushed a commit to dgreiss/arrow that referenced this issue Feb 19, 2024
… not set writer index (apache#38840)

### Rationale for this change

The `doDecompress` function in `Lz4CompressionCodec` misses writing the index when it is compared with the functionality in `ZstdCompressionCodec`. This PR fixes that issue. 

### What changes are included in this PR?

Writes the index for the decompressed ArrowBuf. 

### Are these changes tested?

No

### Are there any user-facing changes?

No
* Closes: apache#38725

Lead-authored-by: Vibhatha Lakmal Abeykoon <vibhatha@gmail.com>
Co-authored-by: vibhatha <vibhatha@gmail.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants