Skip to main content

Module unnest_sql

Module unnest_sql 

Source
Expand description

E5.2 โ€” LATERAL / UNNEST SQL pre-processing.

DataFusion 53 supports UNNEST inside SELECT and FROM clauses for fixed-size arrays. This module provides:

  1. Detection: identify UNNEST calls in SQL text before passing to DataFusion.
  2. Rewriter: normalise the common LATERAL UNNEST idiom to a canonical form that DataFusion can plan (CROSS JOIN UNNEST).
  3. NodeOp builder: return a NodeOp::Unnest descriptor so the Krishiv plan layer can record the unnest operator.

Functionsยง

build_unnest_op
Build a NodeOp::Unnest descriptor.
contains_lateral
Returns true if sql contains a LATERAL keyword (case-insensitive).
contains_unnest
Returns true if sql contains an UNNEST call (case-insensitive).
rewrite_lateral_unnest
Rewrite LATERAL UNNEST(...) idioms to a form DataFusion understands.