Skip to content

Conversation

@askalt
Copy link
Contributor

@askalt askalt commented Feb 3, 2026

Rationale for this change

We support DELETE LIMIT query and it would be good to port our fork patch to the upstream.

What changes are included in this PR?

This patch adds a support for delete statement with limit planning. An inner table scan is wrapped with a limit in this case. e.g.:

query TT
explain delete from t1 limit 10
----
logical_plan
01)Dml: op=[Delete] table=[t1]
02)--Limit: skip=0, fetch=10
03)----TableScan: t1
physical_plan
01)CooperativeExec
02)--DmlResultExec: rows_affected=0

Are these changes tested?

Covered with SLT.

Are there any user-facing changes?

Now queries with limited deletion are successfully planned, instead of returning not-supported error.

This patch adds a support for delete statement with limit planning.
An inner table scan is wrapped with a limit in this case. e.g.:

```
query TT
explain delete from t1 limit 10
----
logical_plan
01)Dml: op=[Delete] table=[t1]
02)--Limit: skip=0, fetch=10
03)----TableScan: t1
physical_plan
01)CooperativeExec
02)--DmlResultExec: rows_affected=0
```
@github-actions github-actions bot added sql SQL Planner sqllogictest SQL Logic Tests (.slt) labels Feb 3, 2026
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sql SQL Planner sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants