This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch branch-2.2
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/branch-2.2 by this push:
new b5ee21a81 ORC-2079: Add `lz4` codec pool test coverage
b5ee21a81 is described below
commit b5ee21a81bdb30a6384a8843945568a8358fa79a
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Fri Feb 6 13:33:56 2026 -0800
ORC-2079: Add `lz4` codec pool test coverage
### What changes were proposed in this pull request?
This PR aims to add `lz4` codec pool test coverage.
### Why are the changes needed?
To improve test coverage and help the future LZ4 migration like the
following.
- #2511
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
`Gemini 3 Pro (High)` on `Antigravity`.
Closes #2517 from dongjoon-hyun/ORC-2079.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 8919dd0f8f1a90eecf4446b51726bd0b69d67778)
Signed-off-by: Dongjoon Hyun <[email protected]>
---
java/core/src/test/org/apache/orc/TestVectorOrcFile.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/java/core/src/test/org/apache/orc/TestVectorOrcFile.java
b/java/core/src/test/org/apache/orc/TestVectorOrcFile.java
index 76681f462..dfa80b212 100644
--- a/java/core/src/test/org/apache/orc/TestVectorOrcFile.java
+++ b/java/core/src/test/org/apache/orc/TestVectorOrcFile.java
@@ -2346,7 +2346,7 @@ public class TestVectorOrcFile implements TestConf {
WriterOptions opts = OrcFile.writerOptions(conf)
.setSchema(schema).stripeSize(1000).bufferSize(100).version(fileFormat);
- CompressionCodec snappyCodec, zlibCodec, zstdCodec;
+ CompressionCodec snappyCodec, zlibCodec, zstdCodec, lz4Codec;
snappyCodec = writeBatchesAndGetCodec(10, 1000,
opts.compress(CompressionKind.SNAPPY), batch);
assertEquals(1, OrcCodecPool.getPoolSize(CompressionKind.SNAPPY));
Reader reader = OrcFile.createReader(testFilePath,
OrcFile.readerOptions(conf).filesystem(fs));
@@ -2375,6 +2375,13 @@ public class TestVectorOrcFile implements TestConf {
assertEquals(1, OrcCodecPool.getPoolSize(CompressionKind.ZSTD));
assertSame(zstdCodec, codec);
+ lz4Codec = writeBatchesAndGetCodec(10, 1000,
opts.compress(CompressionKind.LZ4), batch);
+ assertNotSame(zstdCodec, lz4Codec);
+ assertEquals(1, OrcCodecPool.getPoolSize(CompressionKind.LZ4));
+ codec = writeBatchesAndGetCodec(10, 1000,
opts.compress(CompressionKind.LZ4), batch);
+ assertEquals(1, OrcCodecPool.getPoolSize(CompressionKind.LZ4));
+ assertSame(lz4Codec, codec);
+
assertSame(snappyCodec, OrcCodecPool.getCodec(CompressionKind.SNAPPY));
CompressionCodec snappyCodec2 = writeBatchesAndGetCodec(
10, 1000, opts.compress(CompressionKind.SNAPPY), batch);