From d73887e60a4f7ed99f09856fc707b306ecdb9ace Mon Sep 17 00:00:00 2001 From: Laurens Kuiper Date: Mon, 21 Oct 2024 12:29:43 +0200 Subject: [PATCH] properly deserialize compression_level --- extension/parquet/parquet_extension.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extension/parquet/parquet_extension.cpp b/extension/parquet/parquet_extension.cpp index 0c4fea5b990..45b6d4d8faa 100644 --- a/extension/parquet/parquet_extension.cpp +++ b/extension/parquet/parquet_extension.cpp @@ -1474,9 +1474,12 @@ static unique_ptr ParquetCopyDeserialize(Deserializer &deserialize data->encryption_config, nullptr); deserializer.ReadPropertyWithExplicitDefault(108, "dictionary_compression_ratio_threshold", data->dictionary_compression_ratio_threshold, 1.0); - deserializer.ReadPropertyWithDefault(109, "compression_level", data->compression_level); - if (static_cast(data->compression_level) == DConstants::INVALID_INDEX) { + optional_idx compression_level; + deserializer.ReadPropertyWithDefault(109, "compression_level", compression_level); + if (!compression_level.IsValid()) { data->compression_level = ZStdFileSystem::DefaultCompressionLevel(); // Used to be serialized as an optional_idx + } else { + data->compression_level = static_cast(compression_level.GetIndex()); } data->row_groups_per_file = deserializer.ReadPropertyWithExplicitDefault(110, "row_groups_per_file", optional_idx::Invalid());