Skip to main content

Module subquery

Module subquery 

Source
Expand description

E5.1 — Correlated subquery decorrelation: EXISTS/IN/scalar subquery analysis.

DataFusion 53 already handles subquery decorrelation for batch queries via the DecorrelatePredicateSubquery optimizer rule. This module adds:

  1. AST-level detection of EXISTS/IN/NOT IN/scalar subquery patterns.
  2. Streaming guard: rejects correlated subqueries that reference a registered streaming table — DataFusion does not handle these.
  3. Kind classification so callers can adapt error messages and explain output.

Structs§

DetectedSubquery
A subquery occurrence found in a SQL statement.

Enums§

SubqueryKind
Classification of a subquery occurrence detected in a SQL statement.

Functions§

detect_subqueries
Analyse sql and return every subquery occurrence.
explain_subqueries
Return a human-readable summary of subquery kinds found in sql.
validate_no_streaming_subqueries
Validate that sql contains no subqueries that reference a streaming table.