Skip to content

[DBSP][SQL] Detect negative rows in MATERIALIZED tables #6156

Description

@mihaibudiu

Tables which do not have primary keys allow inserting records with negative weights.
This could happen for example when replaying a CDC stream from some offset.
The SQL semantics is undefined for records with negative weights, and can lead to all sorts of weird behaviors or even runtime panics.
If a table is materialized without a primary key we could use the existing integral to detect whether a deleted row does not already exist and provide an informative error message. This should probably be directed by some property, because it's not cheap -- it will require a read on each insertion.

Metadata

Metadata

Assignees

Labels

DBSP coreRelated to the core DBSP librarySQL compilerRelated to the SQL compiler

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions