feat(sql): lower IN subqueries into joins#2489
Conversation
a1382b0 to
d560869
Compare
|
Adding the short demo asset requested by the Algora bounty guidelines: It summarizes the scoped The remaining external blocker I can see is the CLA status. |
|
CLA is now signed. The demo GIF and validation notes are in the PR body, so this is ready for maintainer review from my side. Thanks! |
|
Hi maintainers, just checking in on this PR. The CLA is signed, the demo asset and validation notes are included, and the branch is still open for review. Please let me know if there is anything else needed from my side to move this toward review/merge or bounty processing. |
/claim #1659
Proposed Changes
This PR adds a scoped first implementation for the remaining
IN (SELECT ...)streaming SQL path:Expr::InSubquerypredicates in the SQL pipeline builder.lhs IN (SELECT rhs FROM ...)into the existing join pipeline by creating an inner join onlhs = subquery_alias.rhs.JoinProcessorFactoryand current join ports instead of introducing a new processor.customer_id IN (...)can resolve against the left side of the generated join.INsubqueries andNOT IN (SELECT ...)explicitly instead of silently building an unsupported selection expression.Demo
Short demo asset: https://github.com/Treasure520520/dozer/releases/download/dozer-1659-demo-2489/dozer-1659-in-subquery-demo.gif
Proof
Added builder regression coverage:
test_in_subquery_is_lowered_into_pipeline_inputschecks that a query withorders.customer_id IN (SELECT allowed_customers.customer_id FROM allowed_customers)builds a pipeline that pulls bothordersandallowed_customersas inputs and registers the requested output table.test_in_subquery_rejects_multi_column_projectionchecks that multi-column subquery projections fail early withUnsupportedSqlError.Validation
Passed locally:
PATH=/Users/treasure/Documents/Codex/2026-05-12/goal-100-paypal-puresenses2021-gmail-com/tools/rustup/toolchains/1.91.1-aarch64-apple-darwin/bin:$PATH rustfmt --check dozer-sql/src/builder/mod.rs dozer-sql/src/builder/tests.rs git diff --checkAttempted but blocked by local macOS toolchain setup before crate compilation:
The failure occurs while linking dependency build scripts (
libc,serde,proc-macro2, etc.) withcc, with exit status 69 and the message:You have not agreed to the Xcode license agreements. No project crate type-checking was reached on this machine.Checklist