[
https://issues.apache.org/jira/browse/CALCITE-7114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mihai Budiu resolved CALCITE-7114.
----------------------------------
Resolution: Fixed
Fixed in
https://github.com/apache/calcite/commit/2fafa5254e40ddcffbf1fcd9ae56c50954763dac
Thank you for the fix [~xuzifu666]
Thank you for the review [~jensen]
> Invalid unparse for cast to array type in Spark
> -----------------------------------------------
>
> Key: CALCITE-7114
> URL: https://issues.apache.org/jira/browse/CALCITE-7114
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Yu Xu
> Assignee: Yu Xu
> Priority: Minor
> Fix For: 1.41.0
>
>
> Based on the Array type, Calcite currently converts it as "integer array", **
> should convert to "array<integer>", we can also refer to document:
> https://spark.apache.org/docs/latest/api/sql/index.html#array_append ** , but
> Spark not support this syntax,test sql:
> {code:java}
> select cast(array(1,2,3) as integer array); {code}
> error as:
> {code:java}
> Error in query:
> extraneous input 'array' expecting ')'(line 1, pos 36)== SQL ==
> select cast(array(1,2,3) as integer array)
> ------------------------------------^^^
> {code}
> should convert to this way:
> {code:java}
> select cast(array(1,2,3) as array<integer>) {code}
> execute is ok:
> {code:java}
> [1,2,3] {code}
> so we need to fix it for Spark.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)