[ 
https://issues.apache.org/jira/browse/CALCITE-7246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated CALCITE-7246:
------------------------------------
    Labels: pull-request-available  (was: )

> UNNEST in spark should  convert to EXPLODE/POSEXPLODE
> -----------------------------------------------------
>
>                 Key: CALCITE-7246
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7246
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: xiaochen.zhou
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: image-2025-10-26-01-05-29-569.png, 
> image-2025-10-26-01-08-04-245.png, image-2025-10-26-01-08-27-611.png
>
>
> The `{{{}unnest`{}}} function is not supported in Spark. When converting to 
> the Spark dialect, it needs to be replaced with the `{{{}explode`{}}} or 
> `{{{}posexplode`{}}} function to achieve the same semantics.
>  
> [https://spark.apache.org/docs/latest/sql-ref-functions-builtin.html#collection-functions]
> !image-2025-10-26-01-08-04-245.png|width=554,height=84!
> !image-2025-10-26-01-08-27-611.png|width=554,height=79!
> *origin sql:*
> ```sql
> SELECT * FROM UNNEST(ARRAY[1,2,3])
> ```
> *spark dialect  should convert to:*
> ```sql
> SELECT * FROM EXPLODE (ARRAY[1,2,3])
> ```



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to