You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] DataFusion UPDATE and DELETE can affect more rows than LIMIT allows #1396
I searched in the issues and found nothing similar.
Please describe the bug 🐞
DataFusion SQLContext drops ORDER BY and LIMIT when selecting rows for UPDATE/DELETE, affecting both Copy-on-Write and Data Evolution tables.
For example, run through SQLContext with the paimon catalog:
CREATESCHEMApaimon.dml_limit_repro;
CREATETABLEpaimon.dml_limit_repro.t (id INT);
INSERT INTOpaimon.dml_limit_repro.t VALUES (1), (2), (3);
DELETEFROMpaimon.dml_limit_repro.t ORDER BY id LIMIT1;
SELECT*FROMpaimon.dml_limit_repro.t ORDER BY id;
Expected: only id=1 is deleted. Actual: all three rows are deleted. UPDATE has the same issue;
Solution
Preserve ORDER BY and LIMIT in the internal selection queries.
Activity