From a750997f05608d0d2e0edbf825ca15424c986382 Mon Sep 17 00:00:00 2001 From: Valery Mironov Date: Tue, 30 Jul 2024 17:26:11 +0300 Subject: [PATCH 1/3] Vector Index should use for posting impl table reserved name for additional column --- ydb/core/base/table_vector_index.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ydb/core/base/table_vector_index.h b/ydb/core/base/table_vector_index.h index 211061b25560..35784545e4ba 100644 --- a/ydb/core/base/table_vector_index.h +++ b/ydb/core/base/table_vector_index.h @@ -6,16 +6,15 @@ namespace NKikimr::NTableIndex::NTableVectorKmeansTreeIndex { // Levels table inline constexpr const char* LevelTable = "indexImplLevelTable"; -inline constexpr const char* LevelTable_ParentIdColumn = "-parent"; +inline constexpr const char* LevelTable_ParentIdColumn = "__ydb_parent"; inline constexpr const char* LevelTable_IdColumn = "-id"; inline constexpr const char* LevelTable_EmbeddingColumn = "-embedding"; // Posting table inline constexpr const char* PostingTable = "indexImplPostingTable"; -inline constexpr const char* PostingTable_ParentIdColumn = "-parent"; +inline constexpr const char* PostingTable_ParentIdColumn = LevelTable_ParentIdColumn; inline constexpr const char* TmpPostingTableSuffix0 = "0tmp"; inline constexpr const char* TmpPostingTableSuffix1 = "1tmp"; } - From e47f770bab30599a7b1f3694e46fb9651bbea5c7 Mon Sep 17 00:00:00 2001 From: Valery Mironov Date: Tue, 30 Jul 2024 17:28:08 +0300 Subject: [PATCH 2/3] fix test --- ydb/core/tx/schemeshard/ut_index/ut_vector_index.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ydb/core/tx/schemeshard/ut_index/ut_vector_index.cpp b/ydb/core/tx/schemeshard/ut_index/ut_vector_index.cpp index d30707717981..4d4e32631529 100644 --- a/ydb/core/tx/schemeshard/ut_index/ut_vector_index.cpp +++ b/ydb/core/tx/schemeshard/ut_index/ut_vector_index.cpp @@ -188,21 +188,21 @@ Y_UNIT_TEST_SUITE(TVectorIndexTests) { TTestEnv env(runtime); ui64 txId = 100; - // base table column should not contains reserved name '-parent' - TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"( + // base table column should not contains reserved name ParentIdColumn + TestCreateIndexedTable(runtime, ++txId, "/MyRoot", Sprintf(R"( TableDescription { Name: "vectors" Columns { Name: "id" Type: "Uint64" } - Columns { Name: "-parent" Type: "String" } + Columns { Name: "%s" Type: "String" } KeyColumnNames: ["id"] } IndexDescription { Name: "idx_vector" - KeyColumnNames: ["-parent"] + KeyColumnNames: ["%s"] Type: EIndexTypeGlobalVectorKmeansTree VectorIndexKmeansTreeDescription: { Settings : { distance: DISTANCE_COSINE, vector_type: VECTOR_TYPE_FLOAT, vector_dimension: 1024 } } } - )", {NKikimrScheme::StatusInvalidParameter}); + )", NTableIndex::NTableVectorKmeansTreeIndex::PostingTable_ParentIdColumn, NTableIndex::NTableVectorKmeansTreeIndex::PostingTable_ParentIdColumn), {NKikimrScheme::StatusInvalidParameter}); // pk should not be covered TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"( From 8b546bdfda223ccb02052da6b6a09bd08bfdca21 Mon Sep 17 00:00:00 2001 From: Valery Mironov Date: Tue, 30 Jul 2024 17:31:56 +0300 Subject: [PATCH 3/3] Update table_vector_index.h --- ydb/core/base/table_vector_index.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ydb/core/base/table_vector_index.h b/ydb/core/base/table_vector_index.h index 35784545e4ba..1807a20e1d9d 100644 --- a/ydb/core/base/table_vector_index.h +++ b/ydb/core/base/table_vector_index.h @@ -4,11 +4,11 @@ namespace NKikimr::NTableIndex::NTableVectorKmeansTreeIndex { // Vector KmeansTree index tables description -// Levels table +// Level table inline constexpr const char* LevelTable = "indexImplLevelTable"; inline constexpr const char* LevelTable_ParentIdColumn = "__ydb_parent"; -inline constexpr const char* LevelTable_IdColumn = "-id"; -inline constexpr const char* LevelTable_EmbeddingColumn = "-embedding"; +inline constexpr const char* LevelTable_IdColumn = "__ydb_id"; +inline constexpr const char* LevelTable_EmbeddingColumn = "__ydb_embedding"; // Posting table inline constexpr const char* PostingTable = "indexImplPostingTable";