Skip to content

Panic: REPLACE INTO ... SELECT on vector tables #23138

@dengn

Description

@dengn

Description

REPLACE INTO ... SELECT ... on tables with vector columns causes a panic in build_replace.go: panic interface conversion: tree.SelectStatement is *tree.SelectClause, not *tree.ValuesClause. We mirror source data from a staging table into the main vector table, but the statement crashes the server.

Schema & Setup

SET experimental_ivf_index = 1;
SET GLOBAL experimental_ivf_index = 1;

DROP TABLE IF EXISTS vec_replace_case;
DROP TABLE IF EXISTS vec_replace_stage;

CREATE TABLE vec_replace_case (
    id INT PRIMARY KEY,
    embedding VECF32(2),
    label CHAR(1)
);
CREATE TABLE vec_replace_stage (
    id INT PRIMARY KEY,
    embedding VECF32(2),
    label CHAR(1)
);
INSERT INTO vec_replace_case VALUES
(1,"[1,2]","A"),
(2,"[2,3]","A"),
(3,"[3,4]","B");
INSERT INTO vec_replace_stage VALUES
(2,"[2.1,3.1]","A"),
(4,"[4,5]","B");
CREATE INDEX idx_vec_replace_case USING ivfflat ON vec_replace_case(embedding)
    LISTS=1 OP_TYPE "vector_l2_ops";

Failing SQL

REPLACE INTO vec_replace_case
SELECT * FROM vec_replace_stage;

Error Message

ERROR 1105 (HY000) at line 22: internal error: panic interface conversion: tree.SelectStatement is *tree.SelectClause, not *tree.ValuesClause
    github.com/matrixorigin/matrixone/pkg/sql/plan.buildReplace ...

Impact

  • Cannot upsert vector data from staging tables using REPLACE.
  • Triggers panic instead of a user-friendly “not supported” message, risking session termination.

Metadata

Metadata

Assignees

Labels

ai-easyStraightforward for AI; factual or single-step taskskind/bugSomething isn't workingno-pr-linkedIssue Closed without PRseverity/s0Extreme impact: Cause the application to break down and seriously affect the use

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions