Skip to content

Commit

Permalink
post-review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-gogov committed Jan 23, 2025
1 parent 06990a6 commit 1cf5f02
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ydb/core/formats/arrow/serializer/native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
6 changes: 1 addition & 5 deletions ydb/core/formats/arrow/serializer/native.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ class TNativeSerializer: public ISerializer {
private:
arrow::ipc::IpcWriteOptions Options;

static inline std::shared_ptr<arrow::util::Codec> DefaultCodec() {
return NArrow::TStatusValidator::GetValid(arrow::util::Codec::Create(arrow::Compression::type::ZSTD, 1));
}

TConclusion<std::shared_ptr<arrow::util::Codec>> BuildCodec(const arrow::Compression::type& cType, const std::optional<ui32> level) const;
static const inline TFactory::TRegistrator<TNativeSerializer> Registrator = TFactory::TRegistrator<TNativeSerializer>(GetClassNameStatic());
protected:
Expand Down Expand Up @@ -67,7 +63,7 @@ class TNativeSerializer: public ISerializer {
static std::shared_ptr<arrow::util::Codec> 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()) {
Expand Down
4 changes: 0 additions & 4 deletions ydb/core/formats/arrow/serializer/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> MinimumCompressionLevel(const arrow::Compression::type compression) {
if (!SupportsCompressionLevel(compression)) {
return {};
Expand Down

0 comments on commit 1cf5f02

Please sign in to comment.