@@ -133,6 +133,30 @@ TString InvalidIndexType(NKikimrSchemeOp::EIndexType indexType) {
133133 return TStringBuilder () << " Invalid index type " << static_cast <int >(indexType);
134134}
135135
136+ std::optional<NKikimrSchemeOp::EIndexType> TryConvertIndexType (Ydb::Table::TableIndex::TypeCase type) {
137+ switch (type) {
138+ case Ydb::Table::TableIndex::TypeCase::TYPE_NOT_SET:
139+ case Ydb::Table::TableIndex::TypeCase::kGlobalIndex :
140+ return NKikimrSchemeOp::EIndexTypeGlobal;
141+ case Ydb::Table::TableIndex::TypeCase::kGlobalAsyncIndex :
142+ return NKikimrSchemeOp::EIndexTypeGlobalAsync;
143+ case Ydb::Table::TableIndex::TypeCase::kGlobalUniqueIndex :
144+ return NKikimrSchemeOp::EIndexTypeGlobalUnique;
145+ case Ydb::Table::TableIndex::TypeCase::kGlobalVectorKmeansTreeIndex :
146+ return NKikimrSchemeOp::EIndexTypeGlobalVectorKmeansTree;
147+ case Ydb::Table::TableIndex::TypeCase::kGlobalFulltextIndex :
148+ return NKikimrSchemeOp::EIndexTypeGlobalFulltext;
149+ default :
150+ return std::nullopt ;
151+ }
152+ }
153+
154+ NKikimrSchemeOp::EIndexType ConvertIndexType (Ydb::Table::TableIndex::TypeCase type) {
155+ const auto result = TryConvertIndexType (type);
156+ Y_ENSURE (result);
157+ return *result;
158+ }
159+
136160bool IsCompatibleIndex (NKikimrSchemeOp::EIndexType indexType, const TTableColumns& table, const TIndexColumns& index, TString& explain) {
137161 if (const auto * broken = IsContains (table.Keys , table.Columns )) {
138162 explain = TStringBuilder ()
@@ -232,7 +256,11 @@ bool DoesIndexSupportTTL(NKikimrSchemeOp::EIndexType indexType) {
232256 }
233257}
234258
235- std::span<const std::string_view> GetImplTables (NKikimrSchemeOp::EIndexType indexType, std::span<const TString> indexKeys) {
259+ std::span<const std::string_view> GetImplTables (
260+ NKikimrSchemeOp::EIndexType indexType,
261+ std::span<const TString> indexKeys,
262+ std::optional<Ydb::Table::FulltextIndexSettings::Layout> layout)
263+ {
236264 switch (indexType) {
237265 case NKikimrSchemeOp::EIndexTypeGlobal:
238266 case NKikimrSchemeOp::EIndexTypeGlobalAsync:
@@ -244,6 +272,9 @@ std::span<const std::string_view> GetImplTables(NKikimrSchemeOp::EIndexType inde
244272 } else {
245273 return PrefixedGlobalKMeansTreeImplTables;
246274 }
275+ case NKikimrSchemeOp::EIndexTypeGlobalFulltext:
276+ Y_ENSURE (layout);
277+ return GetFulltextImplTables (*layout);
247278 default :
248279 Y_ENSURE (false , InvalidIndexType (indexType));
249280 }
0 commit comments