pub fn unnest_to_explode_select(expr: Expression) -> Result<Expression>Expand description
Convert CROSS JOIN UNNEST to LATERAL VIEW EXPLODE/INLINE for Spark/Hive/Databricks.
This is a SELECT-level structural transformation that:
- Converts UNNEST in FROM clause to INLINE/EXPLODE
- Converts CROSS JOIN (LATERAL) UNNEST to LATERAL VIEW entries
- For single-arg UNNEST: uses EXPLODE
- For multi-arg UNNEST: uses INLINE(ARRAYS_ZIP(…))
Based on Python sqlglot’s unnest_to_explode transform in transforms.py (lines 290-391).