Skip to content

Projections on vector indexes incorrectly erased in GMS in-memory database #3430

Description

@nicktobey

This appears to only affect the GMS in-memory database that we use for tests, and does not appear to affect Dolt itself.

CREATE TABLE comp_vector_index_t0 (pk BIGINT PRIMARY KEY, v1 BIGINT, json_column JSON NOT NULL, vector_column VECTOR(2) NOT NULL GENERATED ALWAYS AS (STRING_TO_VECTOR(json_column)) STORED);
INSERT INTO comp_vector_index_t0 (pk, v1, json_column) VALUES (0,0,"[3,16]"),(1,2,"[65,9]"),(2,3,"[38,37]"),(3,3,"[99,99]"),(4,5,"[17,42]"),(5,6,"[6,76]"),(6,6,"[81,33]"), (7,7,"[33,51]"),(8,7,"[37,42]");
select pk, json_column from comp_vector_index_t0 order by vec_distance('[50,50]', json_column) limit 5

Expected output / Dolt output:

+----+-------------+
| pk | json_column |
+----+-------------+
| 8  | [37,42]     |
| 7  | [33,51]     |
| 2  | [38,37]     |
| 4  | [17,42]     |
| 6  | [81,33]     |
+----+-------------+

GMS output:

+----+----+-------------+---------------+
| pk | v1 | json_column | vector_column |
+----+----+-------------+---------------+
| 8  | 7  | [37,42]     | B(B           |
| 7  | 7  | [33,51]     | BLB           |
| 2  | 3  | [38,37]     | BB            |
| 4  | 5  | [17,42]     | �A(B          |
| 6  | 6  | [81,33]     | �BB           |
+----+----+-------------+---------------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions