dolthub / dolthub/dolt

Generated Columns deleted the VECTOR index.

Open
#8,961 1 comment 0 reactions 2 assignees Claimed by @zachmu View on GitHub
bug sql vectors
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

Dolt v1.49.3

Public db: https://www.dolthub.com/repositories/dolthub/robot_blogger_v1

After adding and committing generated columns, the diff shows that the existing vector index was deleted somehow:
```bash
robot_blogger_v1 % db
generated-index-bug-gpt-4o-2024-11-20
* generated-index-bug-llama3
gpt-4o-2024-11-20
llama3
main
robot_blogger_v1 % dolt diff 0sgd75v8ssbp0fc0qm9lkq1tj7bt5dk5
diff --dolt a/langchain_dolt_embedding b/langchain_dolt_embedding
--- a/langchain_dolt_embedding
+++ b/langchain_dolt_embedding
CREATE TABLE `langchain_dolt_embedding` (
`collection_id` varchar(36),
`embedding` json,
`document` longtext,
`cmetadata` json,
`uuid` varchar(36) NOT NULL,
- PRIMARY KEY (`uuid`),
- KEY `langchain_dolt_embedding_collection_id` (`collection_id`),
- VECTOR KEY `langchain_dolt_embedding_embedding_idx` (`embedding`),
+ `name` varchar(255) GENERATED ALWAYS AS (json_unquote(json_extract(`cmetadata`, '$.name'))),
+ `runner` varchar(255) GENERATED ALWAYS AS (json_unquote(json_extract(`cmetadata`, '$.runner'))),
+ `model` varchar(255) GENERATED ALWAYS AS (json_unquote(json_extract(`cmetadata`, '$.model'))),
+ `md5` varchar(255) GENERATED ALWAYS AS (json_unquote(json_extract(`cmetadata`, '$.md5'))),
+ `doc_source_type` varchar(255) GENERATED ALWAYS AS (json_unquote(json_extract(`cmetadata`, '$.doc_source_type'))),
+ PRIMARY KEY (`uuid`),
CONSTRAINT `langchain_dolt_embedding_collection_id_fkey` FOREIGN KEY (`collection_id`) REFERENCES `langchain_dolt_collection` (`uuid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.