Skip to content

Commit

Permalink
vector index should use reserved name for additional column in postin…
Browse files Browse the repository at this point in the history
…g impl table (#7258)
  • Loading branch information
MBkkt authored Jul 31, 2024
1 parent 6a2c5ff commit a0de26d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
11 changes: 5 additions & 6 deletions ydb/core/base/table_vector_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ 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 = "-parent";
inline constexpr const char* LevelTable_IdColumn = "-id";
inline constexpr const char* LevelTable_EmbeddingColumn = "-embedding";
inline constexpr const char* LevelTable_ParentIdColumn = "__ydb_parent";
inline constexpr const char* LevelTable_IdColumn = "__ydb_id";
inline constexpr const char* LevelTable_EmbeddingColumn = "__ydb_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";

}

10 changes: 5 additions & 5 deletions ydb/core/tx/schemeshard/ut_index/ut_vector_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"(
Expand Down

0 comments on commit a0de26d

Please sign in to comment.