Skip to content

Commit b5ee21a

Browse files
committed
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 <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 8919dd0) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
1 parent ac8f925 commit b5ee21a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

java/core/src/test/org/apache/orc/TestVectorOrcFile.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2346,7 +2346,7 @@ public void testCodecPool(Version fileFormat) throws Exception {
23462346
WriterOptions opts = OrcFile.writerOptions(conf)
23472347
.setSchema(schema).stripeSize(1000).bufferSize(100).version(fileFormat);
23482348

2349-
CompressionCodec snappyCodec, zlibCodec, zstdCodec;
2349+
CompressionCodec snappyCodec, zlibCodec, zstdCodec, lz4Codec;
23502350
snappyCodec = writeBatchesAndGetCodec(10, 1000, opts.compress(CompressionKind.SNAPPY), batch);
23512351
assertEquals(1, OrcCodecPool.getPoolSize(CompressionKind.SNAPPY));
23522352
Reader reader = OrcFile.createReader(testFilePath, OrcFile.readerOptions(conf).filesystem(fs));
@@ -2375,6 +2375,13 @@ public void testCodecPool(Version fileFormat) throws Exception {
23752375
assertEquals(1, OrcCodecPool.getPoolSize(CompressionKind.ZSTD));
23762376
assertSame(zstdCodec, codec);
23772377

2378+
lz4Codec = writeBatchesAndGetCodec(10, 1000, opts.compress(CompressionKind.LZ4), batch);
2379+
assertNotSame(zstdCodec, lz4Codec);
2380+
assertEquals(1, OrcCodecPool.getPoolSize(CompressionKind.LZ4));
2381+
codec = writeBatchesAndGetCodec(10, 1000, opts.compress(CompressionKind.LZ4), batch);
2382+
assertEquals(1, OrcCodecPool.getPoolSize(CompressionKind.LZ4));
2383+
assertSame(lz4Codec, codec);
2384+
23782385
assertSame(snappyCodec, OrcCodecPool.getCodec(CompressionKind.SNAPPY));
23792386
CompressionCodec snappyCodec2 = writeBatchesAndGetCodec(
23802387
10, 1000, opts.compress(CompressionKind.SNAPPY), batch);

0 commit comments

Comments
 (0)