Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.13.2
-
None
-
None
Description
Flink SQL> CREATE TABLE nested_type ( > row_type ROW<id BIGINT, data STRING>, > map_type MAP<STRING, BIGINT>, > array_type ARRAY<BIGINT> > ) WITH ('connector'='print'); [INFO] Execute statement succeed. Flink SQL> INSERT INTO nested_type VALUES ((1, 'data'), MAP['key', 1], ARRAY[1,2,3]) > ; [INFO] Submitting SQL update statement to the cluster... [ERROR] Could not execute SQL statement. Reason: org.apache.flink.table.planner.codegen.CodeGenException: Unsupported cast from 'MAP<CHAR(3) NOT NULL, INT NOT NULL> NOT NULL' to 'MAP<STRING, BIGINT>'.
The query works if we change the sink table definition to :
CREATE TABLE nested_type ( row_type ROW<id BIGINT, data STRING>, map_type MAP<STRING, INT>, array_type ARRAY<INT> ) WITH ( 'connector'='print' );
Therefore, I think the root cause of this problem is Flink SQL doesn't support cast for nested types when code generation.
Attachments
Issue Links
- is duplicated by
-
FLINK-17321 Support for casting collection types.
- Closed