@@ -52,17 +52,25 @@ TVector<ISubOperation::TPtr> ApplyBuildIndex(TOperationId nextId, const TTxTrans
52
52
53
53
if (!indexName.empty ())
54
54
{
55
+ auto alterImplTableTransactionTemplate = [] (TPath index , TPath implIndexTable, TTableInfo::TPtr implIndexTableInfo) {
56
+ auto indexImplTableAltering = TransactionTemplate (index .PathString (), NKikimrSchemeOp::EOperationType::ESchemeOpFinalizeBuildIndexImplTable);
57
+ auto alterTable = indexImplTableAltering.MutableAlterTable ();
58
+ alterTable->SetName (implIndexTable.LeafName ());
59
+ alterTable->MutablePartitionConfig ()->MutableCompactionPolicy ()->CopyFrom (implIndexTableInfo->PartitionConfig ().GetCompactionPolicy ());
60
+ alterTable->MutablePartitionConfig ()->MutableCompactionPolicy ()->SetKeepEraseMarkers (false );
61
+ alterTable->MutablePartitionConfig ()->SetShadowData (false );
62
+ return indexImplTableAltering;
63
+ };
64
+
55
65
TPath index = table.Child (indexName);
56
- TPath implIndexTable = index .Child (" indexImplTable" );
57
- TTableInfo::TPtr implIndexTableInfo = context.SS ->Tables .at (implIndexTable.Base ()->PathId );
58
- auto indexImplTableAltering = TransactionTemplate (index .PathString (), NKikimrSchemeOp::EOperationType::ESchemeOpFinalizeBuildIndexImplTable);
59
- auto alterTable = indexImplTableAltering.MutableAlterTable ();
60
- alterTable->SetName (implIndexTable.LeafName ());
61
- alterTable->MutablePartitionConfig ()->MutableCompactionPolicy ()->CopyFrom (implIndexTableInfo->PartitionConfig ().GetCompactionPolicy ());
62
- alterTable->MutablePartitionConfig ()->MutableCompactionPolicy ()->SetKeepEraseMarkers (false );
63
- alterTable->MutablePartitionConfig ()->SetShadowData (false );
64
-
65
- result.push_back (CreateFinalizeBuildIndexImplTable (NextPartId (nextId, result), indexImplTableAltering));
66
+ for (const std::string_view implTable : NTableIndex::ImplTables) {
67
+ TPath implIndexTable = index .Child (implTable.data ());
68
+ if (!implIndexTable.IsResolved ()) {
69
+ continue ;
70
+ }
71
+ TTableInfo::TPtr implIndexTableInfo = context.SS ->Tables .at (implIndexTable.Base ()->PathId );
72
+ result.push_back (CreateFinalizeBuildIndexImplTable (NextPartId (nextId, result), alterImplTableTransactionTemplate (index , implIndexTable, implIndexTableInfo)));
73
+ }
66
74
}
67
75
68
76
return result;
@@ -106,10 +114,10 @@ TVector<ISubOperation::TPtr> CancelBuildIndex(TOperationId nextId, const TTxTran
106
114
107
115
if (!indexName.empty ()) {
108
116
TPath index = table.Child (indexName);
109
- Y_ABORT_UNLESS (index .Base ()->GetChildren ().size () = = 1 );
117
+ Y_ABORT_UNLESS (index .Base ()->GetChildren ().size () > = 1 );
110
118
for (auto & indexChildItems: index .Base ()->GetChildren ()) {
111
119
const TString& implTableName = indexChildItems.first ;
112
- Y_ABORT_UNLESS (implTableName == " indexImplTable " , " unexpected name %s" , implTableName.c_str ());
120
+ Y_ABORT_UNLESS (NTableIndex::IsImplTable ( implTableName) , " unexpected name %s" , implTableName.c_str ());
113
121
114
122
TPath implTable = index .Child (implTableName);
115
123
{
0 commit comments