From 56c4cd903aa2e1f1d20ea9c4e515d0cb843ddd3d Mon Sep 17 00:00:00 2001 From: ivanmorozov333 Date: Wed, 16 Apr 2025 07:58:53 +0300 Subject: spec columns initialization control (#17220) Co-authored-by: ivanmorozov333 --- .../engines/reader/plain_reader/iterator/fetching.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/fetching.cpp b/ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/fetching.cpp index bb355defb13..97ddcb1968d 100644 --- a/ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/fetching.cpp +++ b/ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/fetching.cpp @@ -35,7 +35,8 @@ TConclusion TSnapshotFilter::DoExecuteInplace(const std::shared_ptr TDeletionFilter::DoExecuteInplace(const std::shared_ptr& source, const TFetchingScriptCursor& /*step*/) const { - auto collection = source->GetStageData().GetTable()->SelectOptional(std::vector({ (ui32)IIndexInfo::ESpecialColumn::DELETE_FLAG }), false); + auto collection = + source->GetStageData().GetTable()->SelectOptional(std::vector({ (ui32)IIndexInfo::ESpecialColumn::DELETE_FLAG }), false); if (!collection) { return true; } @@ -95,9 +96,16 @@ TConclusion TDetectInMem::DoExecuteInplace(const std::shared_ptr TBuildFakeSpec::DoExecuteInplace(const std::shared_ptr& source, const TFetchingScriptCursor& /*step*/) const { std::vector> columns; for (auto&& f : IIndexInfo::ArrowSchemaSnapshot()->fields()) { - source->MutableStageData().GetTable()->AddVerified(IIndexInfo::GetColumnIdVerified(f->name()), - std::make_shared( - NArrow::TThreadSimpleArraysCache::GetConst(f->type(), NArrow::DefaultScalar(f->type()), source->GetRecordsCount())), true); + if (source->MutableStageData().GetTable()->HasColumn(IIndexInfo::GetColumnIdVerified(f->name()))) { + auto arr = source->MutableStageData().GetTable()->GetArrayVerified(IIndexInfo::GetColumnIdVerified(f->name())); + AFL_WARN(NKikimrServices::TX_COLUMNSHARD_SCAN)("event", "spec_column_exists")("column_name", f->name())( + "col", NArrow::DebugJson(arr, 2, 2).GetStringRobust()); + } else { + source->MutableStageData().GetTable()->AddVerified(IIndexInfo::GetColumnIdVerified(f->name()), + std::make_shared( + NArrow::TThreadSimpleArraysCache::GetConst(f->type(), NArrow::DefaultScalar(f->type()), source->GetRecordsCount())), + true); + } } return true; } -- cgit v1.3