From 1cf5f023f6517ef21375cf3c28442bbb4b6ede16 Mon Sep 17 00:00:00 2001 From: vlad-gogov Date: Thu, 23 Jan 2025 09:56:40 +0000 Subject: [PATCH] post-review fixes --- ydb/core/formats/arrow/serializer/native.cpp | 2 +- ydb/core/formats/arrow/serializer/native.h | 6 +----- ydb/core/formats/arrow/serializer/utils.cpp | 4 ---- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/ydb/core/formats/arrow/serializer/native.cpp b/ydb/core/formats/arrow/serializer/native.cpp index cd51b840640e..a580ed33414f 100644 --- a/ydb/core/formats/arrow/serializer/native.cpp +++ b/ydb/core/formats/arrow/serializer/native.cpp @@ -143,7 +143,7 @@ NKikimr::TConclusionStatus TNativeSerializer::DoDeserializeFromRequest(NYql::TFe level = levelLocal; } } - auto codecPtrStatus = BuildCodec(codec.value_or(GetDefaultCompressionType()), level); + auto codecPtrStatus = BuildCodec(codec.value_or(Options.codec->compression_type()), level); if (!codecPtrStatus) { return codecPtrStatus.GetError(); } diff --git a/ydb/core/formats/arrow/serializer/native.h b/ydb/core/formats/arrow/serializer/native.h index c3cbad051c39..372ce988a07f 100644 --- a/ydb/core/formats/arrow/serializer/native.h +++ b/ydb/core/formats/arrow/serializer/native.h @@ -23,10 +23,6 @@ class TNativeSerializer: public ISerializer { private: arrow::ipc::IpcWriteOptions Options; - static inline std::shared_ptr DefaultCodec() { - return NArrow::TStatusValidator::GetValid(arrow::util::Codec::Create(arrow::Compression::type::ZSTD, 1)); - } - TConclusion> BuildCodec(const arrow::Compression::type& cType, const std::optional level) const; static const inline TFactory::TRegistrator Registrator = TFactory::TRegistrator(GetClassNameStatic()); protected: @@ -67,7 +63,7 @@ class TNativeSerializer: public ISerializer { static std::shared_ptr GetDefaultCodec() { if (!HasAppData() || (!AppData()->ColumnShardConfig.HasDefaultCompression() && !AppData()->ColumnShardConfig.HasDefaultCompressionLevel())) { - return DefaultCodec(); + return NArrow::TStatusValidator::GetValid(arrow::util::Codec::Create(arrow::Compression::type::ZSTD, 1)); } arrow::Compression::type codec = GetDefaultCompressionType(); if (AppData()->ColumnShardConfig.HasDefaultCompressionLevel()) { diff --git a/ydb/core/formats/arrow/serializer/utils.cpp b/ydb/core/formats/arrow/serializer/utils.cpp index 0bcd5ba28770..cda91a203b10 100644 --- a/ydb/core/formats/arrow/serializer/utils.cpp +++ b/ydb/core/formats/arrow/serializer/utils.cpp @@ -20,10 +20,6 @@ bool SupportsCompressionLevel(const arrow::Compression::type compression, const return true; } -bool SupportsCompressionLevel(const NKikimrSchemeOp::EColumnCodec compression, const i32 compressionLevel) { - return SupportsCompressionLevel(CompressionFromProto(compression).value(), compressionLevel); -} - std::optional MinimumCompressionLevel(const arrow::Compression::type compression) { if (!SupportsCompressionLevel(compression)) { return {};