Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaurav Sagar committed Nov 7, 2024
1 parent 08b8825 commit dea95a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sqlglot/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,11 @@ def _udtf_type(u: exp.Unnest, has_multi_expr: bool) -> t.Type[exp.Func]:

alias_cols = alias.columns if alias else []

# # Handle UNNEST to LATERAL VIEW EXPLODE: Exception is raised when there are 0 or >= 2 aliases
# # Handle UNNEST to LATERAL VIEW EXPLODE: Exception is raised when there are 0 or >= 2 aliases
# Spark LATERAL VIEW EXPLODE requires single alias for array/struct and two for Map type column unlike unnest in trino/presto which can take an arbitrary amount.
# Refs: https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-lateral-view.html

if not has_multi_expr and len(alias_cols) !=1:
if not has_multi_expr and len(alias_cols) != 1:
raise UnsupportedError(
"CROSS JOIN UNNEST to LATERAL VIEW EXPLODE transformation requires explicit column aliases"
)
Expand Down

0 comments on commit dea95a0

Please sign in to comment.