Skip to content

Commit 56c4cd9

Browse files
ivanmorozov333ivanmorozov333
andauthored
spec columns initialization control (#17220)
Co-authored-by: ivanmorozov333 <imorozov333@ya.ru>
1 parent 6740986 commit 56c4cd9

File tree

1 file changed

+12
-4
lines changed
  • ydb/core/tx/columnshard/engines/reader/plain_reader/iterator

1 file changed

+12
-4
lines changed

ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/fetching.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ TConclusion<bool> TSnapshotFilter::DoExecuteInplace(const std::shared_ptr<IDataS
3535
}
3636

3737
TConclusion<bool> TDeletionFilter::DoExecuteInplace(const std::shared_ptr<IDataSource>& source, const TFetchingScriptCursor& /*step*/) const {
38-
auto collection = source->GetStageData().GetTable()->SelectOptional(std::vector<ui32>({ (ui32)IIndexInfo::ESpecialColumn::DELETE_FLAG }), false);
38+
auto collection =
39+
source->GetStageData().GetTable()->SelectOptional(std::vector<ui32>({ (ui32)IIndexInfo::ESpecialColumn::DELETE_FLAG }), false);
3940
if (!collection) {
4041
return true;
4142
}
@@ -95,9 +96,16 @@ TConclusion<bool> TDetectInMem::DoExecuteInplace(const std::shared_ptr<IDataSour
9596
TConclusion<bool> TBuildFakeSpec::DoExecuteInplace(const std::shared_ptr<IDataSource>& source, const TFetchingScriptCursor& /*step*/) const {
9697
std::vector<std::shared_ptr<arrow::Array>> columns;
9798
for (auto&& f : IIndexInfo::ArrowSchemaSnapshot()->fields()) {
98-
source->MutableStageData().GetTable()->AddVerified(IIndexInfo::GetColumnIdVerified(f->name()),
99-
std::make_shared<NArrow::NAccessor::TTrivialArray>(
100-
NArrow::TThreadSimpleArraysCache::GetConst(f->type(), NArrow::DefaultScalar(f->type()), source->GetRecordsCount())), true);
99+
if (source->MutableStageData().GetTable()->HasColumn(IIndexInfo::GetColumnIdVerified(f->name()))) {
100+
auto arr = source->MutableStageData().GetTable()->GetArrayVerified(IIndexInfo::GetColumnIdVerified(f->name()));
101+
AFL_WARN(NKikimrServices::TX_COLUMNSHARD_SCAN)("event", "spec_column_exists")("column_name", f->name())(
102+
"col", NArrow::DebugJson(arr, 2, 2).GetStringRobust());
103+
} else {
104+
source->MutableStageData().GetTable()->AddVerified(IIndexInfo::GetColumnIdVerified(f->name()),
105+
std::make_shared<NArrow::NAccessor::TTrivialArray>(
106+
NArrow::TThreadSimpleArraysCache::GetConst(f->type(), NArrow::DefaultScalar(f->type()), source->GetRecordsCount())),
107+
true);
108+
}
101109
}
102110
return true;
103111
}

0 commit comments

Comments
 (0)