Skip to content

feat: support intersect set operations#340

Merged
KKould merged 1 commit intomainfrom
feat/intersect-set-membership
May 4, 2026
Merged

feat: support intersect set operations#340
KKould merged 1 commit intomainfrom
feat/intersect-set-membership

Conversation

@KKould
Copy link
Copy Markdown
Member

@KKould KKould commented May 4, 2026

What problem does this PR solve?

Support INTERSECT / INTERSECT ALL set operations and reduce duplicated implementation between EXCEPT and INTERSECT.

Issue link: N/A

What is changed and how it works?

  • Add binder/planner/executor support for INTERSECT and INTERSECT ALL.
  • Merge EXCEPT and INTERSECT execution into a shared SetMembership operator with SetMembershipKind::{Except, Intersect}.
  • Add ORM .intersect(...) set query builder support.
  • Rename the project set-operation SLT from union.slt to set_operation.slt and cover UNION, EXCEPT, and INTERSECT with distinct/all, tuple values, duplicate-count edge cases, NULL membership, and ordering.

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

Test commands:

cargo check
cargo run -p sqllogictest-test -- --path 'tests/slt/set_operation.slt'
cargo test --all

Side effects

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

Note for reviewer

The SQL standard fixture directory is left unchanged; the broader set-operation coverage lives in the project-owned tests/slt/set_operation.slt.

@KKould KKould self-assigned this May 4, 2026
@KKould KKould added the enhancement New feature or request label May 4, 2026
@KKould KKould merged commit fa23627 into main May 4, 2026
14 checks passed
@KKould KKould linked an issue May 4, 2026 that may be closed by this pull request
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 INTERSECT set operator

1 participant