[ 
https://issues.apache.org/jira/browse/FLINK-9161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17676305#comment-17676305
 ] 

Sai Sharath Dandi commented on FLINK-9161:
------------------------------------------

[~leonard] ROW does not support creating nested type out of a nested type/array 
type input. 
{code:java}
SELECT CAST(ROW(person.name, person.age) as ROW< new_name string, new_age int > 
) as new_person FROM (VALUES (CAST(ROW('Bob', 10) as ROW< name string, age 
int>)),(CAST(ROW('Alice', 20) as ROW< name string, age int>))) AS 
PersonTable(person);
>
[ERROR] Could not execute SQL statement. Reason:
org.apache.flink.sql.parser.impl.ParseException: Encountered "." at line 1, 
column 23.
Was expecting one of:
    ")" ...
    "," ... {code}
Is there any workaround solution here?

> Support STRUCT syntax to create named STRUCT in SQL
> ---------------------------------------------------
>
>                 Key: FLINK-9161
>                 URL: https://issues.apache.org/jira/browse/FLINK-9161
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table SQL / API
>            Reporter: Shuyi Chen
>            Priority: Major
>              Labels: auto-unassigned
>
> As discussed in [calcite dev mailing 
> list|https://mail-archives.apache.org/mod_mbox/calcite-dev/201804.mbox/%3cCAMZk55avGNmp1vXeJwA1B_a8bGyCQ9ahxmE=R=6fklpf7jt...@mail.gmail.com%3e],
>  we want add support for adding named structure construction in SQL, e.g., 
> {code:java}
> SELECT STRUCT(a as first_name, b as last_name, STRUCT(c as zip code, d as
> street, e as state) as address) as record FROM example_table
> {code}
> This would require adding necessary change in Calcite first.



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

Reply via email to