summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorivanmorozov333 <[email protected]>2025-04-16 07:58:53 +0300
committerGitHub <[email protected]>2025-04-16 07:58:53 +0300
commit56c4cd903aa2e1f1d20ea9c4e515d0cb843ddd3d (patch)
treedce61c1773097ac957a2ebaa140128be31dbd580
parent6740986a20eebf11b26f94ada9c8d0b081ff3ff2 (diff)
spec columns initialization control (#17220)
Co-authored-by: ivanmorozov333 <[email protected]>
-rw-r--r--ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/fetching.cpp16
1 files 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<bool> TSnapshotFilter::DoExecuteInplace(const std::shared_ptr<IDataS
}
TConclusion<bool> TDeletionFilter::DoExecuteInplace(const std::shared_ptr<IDataSource>& source, const TFetchingScriptCursor& /*step*/) const {
- auto collection = source->GetStageData().GetTable()->SelectOptional(std::vector<ui32>({ (ui32)IIndexInfo::ESpecialColumn::DELETE_FLAG }), false);
+ auto collection =
+ source->GetStageData().GetTable()->SelectOptional(std::vector<ui32>({ (ui32)IIndexInfo::ESpecialColumn::DELETE_FLAG }), false);
if (!collection) {
return true;
}
@@ -95,9 +96,16 @@ TConclusion<bool> TDetectInMem::DoExecuteInplace(const std::shared_ptr<IDataSour
TConclusion<bool> TBuildFakeSpec::DoExecuteInplace(const std::shared_ptr<IDataSource>& source, const TFetchingScriptCursor& /*step*/) const {
std::vector<std::shared_ptr<arrow::Array>> columns;
for (auto&& f : IIndexInfo::ArrowSchemaSnapshot()->fields()) {
- source->MutableStageData().GetTable()->AddVerified(IIndexInfo::GetColumnIdVerified(f->name()),
- std::make_shared<NArrow::NAccessor::TTrivialArray>(
- 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::NAccessor::TTrivialArray>(
+ NArrow::TThreadSimpleArraysCache::GetConst(f->type(), NArrow::DefaultScalar(f->type()), source->GetRecordsCount())),
+ true);
+ }
}
return true;
}