From 8bde797fe8d56980bd876e6e168fb546bc09ed75 Mon Sep 17 00:00:00 2001 From: Michael Kolupaev Date: Fri, 19 Sep 2025 19:03:50 +0000 Subject: [PATCH] Merge pull request #87258 from ClickHouse/pq0 Fix 'Invalid dict indices bit width: 0' in parquet reader v3 --- src/Processors/Formats/Impl/Parquet/Decoding.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Processors/Formats/Impl/Parquet/Decoding.cpp b/src/Processors/Formats/Impl/Parquet/Decoding.cpp index a3cfb47ee8f9..96cdd15c4a4d 100644 --- a/src/Processors/Formats/Impl/Parquet/Decoding.cpp +++ b/src/Processors/Formats/Impl/Parquet/Decoding.cpp @@ -41,7 +41,7 @@ struct BitPackedRLEDecoder : public PageDecoder requireRemainingBytes(1); bit_width = size_t(UInt8(*data)); data += 1; - if (bit_width > 8 * sizeof(T) || (bit_width == 0 && limit > 1)) + if (bit_width > 8 * sizeof(T)) throw Exception(ErrorCodes::INCORRECT_DATA, "Invalid dict indices bit width: {}", bit_width); } else @@ -120,7 +120,7 @@ struct BitPackedRLEDecoder : public PageDecoder { if (bit_width == 0) { - /// bit_width == 0 can be used for dictionary indices if the dictionary has only one value. + /// bit_width == 0 means all values are 0. if constexpr (!skip) memset(out, 0, num_values * sizeof(T)); return;