Skip to content

vector index should use reserved name for additional column in posting impl table #7258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading