Yu Xu created CALCITE-7114:
------------------------------

             Summary: 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
             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)

Reply via email to