Skip to content

fix: support joined update and delete#337

Merged
KKould merged 1 commit intomainfrom
fix/joined-dml
May 3, 2026
Merged

fix: support joined update and delete#337
KKould merged 1 commit intomainfrom
fix/joined-dml

Conversation

@KKould
Copy link
Copy Markdown
Member

@KKould KKould commented May 3, 2026

What problem does this PR solve?

Issue link: Fixes #321

Support UPDATE ... JOIN ... and DELETE ... JOIN ... for joined tables while preserving the target table tuple semantics.

What is changed and how it works?

  • Allow joined UPDATE/DELETE to use the normal bound join plan instead of maintaining a separate DML join-type whitelist.
  • Keep UPDATE execution single-table oriented by projecting joined input back to the target table columns before the Update operator.
  • Propagate the primary key from the side marked by with_pk through hash and nested-loop joins.
  • Localize right-side predicates before pushing them into a join right child, fixing source-side joined DML predicates.
  • Add an e2e sqllogictest covering inner/left/right/full/cross joined UPDATE and DELETE paths.

Code changes

  • Has Rust code change
  • Has CI related scripts change

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Commands run:

  • cargo fmt
  • cargo check
  • cargo run -p sqllogictest-test -- --path tests/slt/joined_dml.slt
  • cargo test -p kite_sql execution::dql::join
  • cargo test -p kite_sql push_predicate_through_join

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Note for reviewer

Joined DML now relies on target-table pk propagation plus the UPDATE target projection, so unsupported join forms are not filtered by a DML-specific binder helper. Source-only outer rows naturally have no target pk and are skipped by UPDATE/DELETE.

@KKould KKould self-assigned this May 3, 2026
@KKould KKould added the enhancement New feature or request label May 3, 2026
@KKould KKould force-pushed the fix/joined-dml branch from 1e233a8 to 8f54741 Compare May 3, 2026 13:31
@KKould KKould force-pushed the fix/joined-dml branch from 8f54741 to d1e427e Compare May 3, 2026 13:35
@KKould KKould merged commit b0f7bc9 into main May 3, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support UPDATE ... JOIN ... and DELETE ... JOIN ...

1 participant