lyne7-sc opened a new issue, #1396:
URL: https://github.com/apache/paimon-rust/issues/1396

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/paimon-rust/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:
   
   ```sql
   CREATE SCHEMA paimon.dml_limit_repro;
   CREATE TABLE paimon.dml_limit_repro.t (id INT);
   INSERT INTO paimon.dml_limit_repro.t VALUES (1), (2), (3);
   DELETE FROM paimon.dml_limit_repro.t ORDER BY id LIMIT 1;
   SELECT * FROM paimon.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.
   
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to