Skip to content

Support row-valued IN subqueries - #63

Merged
osipovartem merged 1 commit into
embucket-sync-df55.0.0from
snowflake-tuple-in-subquery
Sep 4, 2026
Merged

Support row-valued IN subqueries#63
osipovartem merged 1 commit into
embucket-sync-df55.0.0from
snowflake-tuple-in-subquery

Conversation

@osipovartem

Copy link
Copy Markdown
Collaborator

Summary

  • lower a row-valued IN (subquery) to an EXISTS predicate with positional component comparisons
  • preserve correlated outer references and reject tuple/subquery arity mismatches during SQL planning
  • cover projected values, top-level predicates, empty inputs, NULL-containing rows, and diagnostics

Snowflake compatibility

A live Snowflake oracle confirmed the covered behavior:

  • exact non-NULL tuple: TRUE
  • missing tuple: FALSE
  • tuple comparisons containing NULL: FALSE
  • empty subquery: FALSE

Snowflake currently rejects the separate row-valued NOT IN (subquery) form as an unsupported subquery, so this PR does not claim that form as an oracle case.

Validation

  • cargo +1.97.0 fmt --all -- --check
  • cargo +1.97.0 test -p datafusion-sqllogictest --test sqllogictests -- subquery_projection --test-threads 1
  • cargo +1.97.0 test -p datafusion-sql (92 unit, 584 integration, 12 doc passed)
  • cargo +1.97.0 clippy -p datafusion-sql --all-targets -- -D warnings

@osipovartem
osipovartem merged commit 83535d7 into embucket-sync-df55.0.0 Sep 4, 2026
19 checks passed
@osipovartem
osipovartem deleted the snowflake-tuple-in-subquery branch September 4, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant