You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Martijn Visser (Jira)" <ji...@apache.org> on 2022/07/13 07:30:00 UTC

[jira] [Commented] (FLINK-28518) Exception: AssertionError: Cannot add expression of different type to set in sub-query with ROW type

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

Martijn Visser commented on FLINK-28518:
----------------------------------------

[~jark] [~godfrey] Is this indeed a bug?

> Exception: AssertionError: Cannot add expression of different type to set in sub-query with ROW type
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-28518
>                 URL: https://issues.apache.org/jira/browse/FLINK-28518
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.15.1
>            Reporter: Koylubaev Nikita
>            Priority: Major
>         Attachments: test.sql
>
>
> All scripts is attached to file: test.sql
> Create 2 tables:
>  
> {code:java}
> SET
> 'sql-client.execution.result-mode' = 'tableau';
> SET
> 'execution.runtime-mode' = 'batch';
> SET
> 'sql-client.execution.mode' = 'streaming';
> SET
> 'parallelism.default' = '8';
> SET
> 'table.dml-sync' = 'true';
> CREATE
> TEMPORARY TABLE fl (
> `id` INT,
> `name` STRING) 
> WITH (    
> 'connector' = 'faker',
> 'number-of-rows' = '10',
> 'rows-per-second' = '10000',
> 'fields.id.expression' = '#{number.numberBetween ''0'',''10''}',
>     'fields.name.expression' = '#{superhero.name}');
> CREATE
> TEMPORARY TABLE application (
> `id` INT,
> `fl_id` INT,
> `num` INT,
> `db` DOUBLE) 
> WITH (
> 'connector' = 'faker',
> 'number-of-rows' = '100',
> 'rows-per-second' = '1000000',
> 'fields.id.expression' = '#{number.numberBetween ''0'',''1000000''}',
> 'fields.fl_id.expression' = '#{number.numberBetween ''0'',''10''}',
> 'fields.num.expression' = '#{number.numberBetween ''-2147483648'',''2147483647''}',
> 'fields.db.expression' = '#{number.randomDouble ''3'',''-1000'',''1000''}'); {code}
> The next SQL throw exception:
> {code:java}
> select fl.name,
>        (select (COLLECT(application.num), COLLECT(application.db))
>         from application
>         where fl.id = application.fl_id)
> from fl;{code}
> Error stack trace is (I marked what is different in type: it's just NOT NULL):
>  
>  
> {code:java}
> [ERROR] Could not execute SQL statement. Reason:
> java.lang.AssertionError: Cannot add expression of different type to set:
> set type is RecordType(INTEGER id, VARCHAR(2147483647) CHARACTER SET "UTF-16LE" name, RecordType(INTEGER MULTISET EXPR$0, DOUBLE MULTISET EXPR$1) $f0) NOT NULL
> expression type is RecordType(INTEGER id, VARCHAR(2147483647) CHARACTER SET "UTF-16LE" name, RecordType(INTEGER MULTISET EXPR$0, DOUBLE MULTISET EXPR$1) NOT NULL $f0) NOT NULL
> set is rel#129:LogicalCorrelate.NONE.any.[](left=HepRelVertex#119,right=HepRelVertex#128,correlation=$cor0,joinType=left,requiredColumns={0})
> expression is LogicalProject(id=[$0], name=[$1], $f0=[ROW($2, $3)])
>   LogicalCorrelate(correlation=[$cor0], joinType=[left], requiredColumns=[{0}])
>     LogicalTableScan(table=[[default_catalog, default_database, fl]])
>     LogicalAggregate(group=[{}], agg#0=[COLLECT($0)], agg#1=[COLLECT($1)])
>       LogicalProject(num=[$2], db=[$3])
>         LogicalFilter(condition=[=($cor0.id, $1)])
>           LogicalTableScan(table=[[default_catalog, default_database, application]])
>  {code}
>  
>  
>  



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