Skip to content

Commit

Permalink
resolve conversations
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-gogov committed Jan 15, 2025
1 parent dc5c43d commit f94e573
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ydb/core/base/appdata_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,15 @@ inline TAppData* AppData(NActors::TActorSystem* actorSystem) {
}

inline bool HasAppData() {
return !!NActors::TlsActivationContext;
return !!NActors::TlsActivationContext && NActors::TlsActivationContext->ExecutorThread.ActorSystem &&
NActors::TlsActivationContext->ExecutorThread.ActorSystem->AppData<TAppData>();
}

inline TAppData& AppDataVerified() {
Y_ABORT_UNLESS(HasAppData());
auto& actorSystem = NActors::TlsActivationContext->ExecutorThread.ActorSystem;
Y_ABORT_UNLESS(actorSystem);
TAppData* const x = actorSystem->AppData<TAppData>();
Y_ABORT_UNLESS(x && x->Magic == TAppData::MagicTag);
Y_ABORT_UNLESS(x->Magic == TAppData::MagicTag);
return *x;
}

Expand Down
8 changes: 5 additions & 3 deletions ydb/core/formats/arrow/serializer/native.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ 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 @@ -63,14 +67,12 @@ class TNativeSerializer: public ISerializer {
static std::shared_ptr<arrow::util::Codec> GetDefaultCodec() {
if (!HasAppData() ||
(!AppData()->ColumnShardConfig.HasDefaultCompression() && !AppData()->ColumnShardConfig.HasDefaultCompressionLevel())) {
return NArrow::TStatusValidator::GetValid(arrow::util::Codec::Create(arrow::Compression::type::ZSTD, 1));
return DefaultCodec();
}
arrow::Compression::type codec = GetDefaultCompressionType();
if (AppData()->ColumnShardConfig.HasDefaultCompressionLevel()) {
return NArrow::TStatusValidator::GetValid(
arrow::util::Codec::Create(codec, AppData()->ColumnShardConfig.GetDefaultCompressionLevel()));
} else if (codec == arrow::Compression::ZSTD) {
return NArrow::TStatusValidator::GetValid(arrow::util::Codec::Create(codec, 1));
}
return NArrow::TStatusValidator::GetValid(arrow::util::Codec::Create(codec));
}
Expand Down

0 comments on commit f94e573

Please sign in to comment.