From d7e49f23e133d9f36a79f9e365ff806a63bbd6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Mej=C3=ADa?= Date: Fri, 12 Jun 2026 12:22:24 +0200 Subject: [PATCH 1/2] Fix OOM in TestByteBitPacking512VectorLE on CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 512-bit vector tests were allocating arrays of 268 million elements (~1 GB each) and iterating through the entire value space (up to 524K chunks for bitWidth=32). On the JDK 21 CI runner — which has AVX-512 support so the tests are not skipped — the heap was exceeded, causing OutOfMemoryError in the DirectByteBuffer and ReadOnlyByteBuffer tests. Reduce itemMax from 268435456 to 8192 (still 512+ vector iterations per chunk) and only test the first and last chunks via a stream filter. This covers both low-range and high-range boundary values while keeping memory trivial (~33 KB per array) and runtime under 1 second. Assisted-by: GitHub Copilot:claude-opus-4.6 (cherry picked from commit 73204ee351d8702cd4f0cc85f3f1055b8009cbf4) --- .../bitpacking/TestByteBitPacking512VectorLE.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/parquet-plugins/parquet-encoding-vector/src/test/java/org/apache/parquet/column/values/bitpacking/TestByteBitPacking512VectorLE.java b/parquet-plugins/parquet-encoding-vector/src/test/java/org/apache/parquet/column/values/bitpacking/TestByteBitPacking512VectorLE.java index 3a510d2696..20d66439d4 100644 --- a/parquet-plugins/parquet-encoding-vector/src/test/java/org/apache/parquet/column/values/bitpacking/TestByteBitPacking512VectorLE.java +++ b/parquet-plugins/parquet-encoding-vector/src/test/java/org/apache/parquet/column/values/bitpacking/TestByteBitPacking512VectorLE.java @@ -42,7 +42,7 @@ public void unpackValuesUsingVector() { } private void unpackValuesUsingVectorBitWidth(int bitWidth) { - try (Stream intInputs = getRangeData(bitWidth)) { + try (Stream intInputs = getRangeData(bitWidth, 8192)) { intInputs.forEach(intInput -> { int pack8Count = intInput.length / 8; int byteOutputSize = pack8Count * bitWidth; @@ -121,9 +121,7 @@ public void unpackValuesUsingVectorByteBuffer(int bitWidth, ByteBuffer input, in } } - private Stream getRangeData(int bitWidth) { - int itemMax = 268435456; - + private Stream getRangeData(int bitWidth, int itemMax) { long maxValue = getMaxValue(bitWidth); long maxValueFilled = maxValue + 1; int itemCount = (int) (maxValueFilled / itemMax); @@ -134,7 +132,10 @@ private Stream getRangeData(int bitWidth) { final int finalItemCount = itemCount; - return IntStream.range(0, finalItemCount).mapToObj(i -> { + // Test the first and last chunks to cover both low-range and high-range boundary values. + return IntStream.range(0, finalItemCount) + .filter(i -> i == 0 || i == finalItemCount - 1) + .mapToObj(i -> { int len; if ((i == finalItemCount - 1) && mode != 0) { len = mode; From f6a218ddfcda65ce617ce0cb54b6eddaa2f6c33b Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sun, 22 Nov 2026 14:18:51 +0100 Subject: [PATCH 2/2] fix spotless check --- .../values/bitpacking/TestByteBitPacking512VectorLE.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/parquet-plugins/parquet-encoding-vector/src/test/java/org/apache/parquet/column/values/bitpacking/TestByteBitPacking512VectorLE.java b/parquet-plugins/parquet-encoding-vector/src/test/java/org/apache/parquet/column/values/bitpacking/TestByteBitPacking512VectorLE.java index 20d66439d4..080835de56 100644 --- a/parquet-plugins/parquet-encoding-vector/src/test/java/org/apache/parquet/column/values/bitpacking/TestByteBitPacking512VectorLE.java +++ b/parquet-plugins/parquet-encoding-vector/src/test/java/org/apache/parquet/column/values/bitpacking/TestByteBitPacking512VectorLE.java @@ -133,9 +133,8 @@ private Stream getRangeData(int bitWidth, int itemMax) { final int finalItemCount = itemCount; // Test the first and last chunks to cover both low-range and high-range boundary values. - return IntStream.range(0, finalItemCount) - .filter(i -> i == 0 || i == finalItemCount - 1) - .mapToObj(i -> { + IntStream stream = IntStream.range(0, finalItemCount).filter(i -> i == 0 || i == finalItemCount - 1); + return stream.mapToObj(i -> { int len; if ((i == finalItemCount - 1) && mode != 0) { len = mode;