Skip to content

Commit 42ba828

Browse files
fix
1 parent 8390871 commit 42ba828

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ydb/core/tx/columnshard/test_helper/columnshard_ut_common.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,16 +435,22 @@ namespace NKikimr::NColumnShard {
435435
NOlap::TIndexInfo BuildTableInfo(const std::vector<NArrow::NTest::TTestColumn>& ydbSchema,
436436
const std::vector<NArrow::NTest::TTestColumn>& key) {
437437
THashMap<ui32, NTable::TColumn> columns;
438+
THashMap<TString, NTable::TColumn*> columnByName;
438439
for (ui32 i = 0; i < ydbSchema.size(); ++i) {
439440
ui32 id = i + 1;
440441
auto& name = ydbSchema[i].GetName();
441442
auto& type = ydbSchema[i].GetType();
442443

443444
columns[id] = NTable::TColumn(name, id, type, "");
445+
AFL_VERIFY(columnByName.emplace(name, &columns[id]).second);
444446
}
445447

446448
std::vector<TString> pkNames;
449+
ui32 idx = 0;
447450
for (const auto& c : key) {
451+
auto it = columnByName.find(c.GetName());
452+
AFL_VERIFY(it != columnByName.end());
453+
it->second->KeyOrder = idx++;
448454
pkNames.push_back(c.GetName());
449455
}
450456
return NOlap::TIndexInfo::BuildDefault(NOlap::TTestStoragesManager::GetInstance(), columns, pkNames);

0 commit comments

Comments
 (0)