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

Jark Wu commented on FLINK-32276:
---------------------------------

[~yesorno] it works as expected. Adding a condition for {{dim.age > 10}} means 
{{dim.age}} shouldn't be NULL. "LEFT JOIN + right record is not null" can be 
optimized into INNER JOIN, they are equal.

> After adding the where condition to the flink lookup left join, the joinType 
> becomes innerJoin
> ----------------------------------------------------------------------------------------------
>
>                 Key: FLINK-32276
>                 URL: https://issues.apache.org/jira/browse/FLINK-32276
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / JDBC
>    Affects Versions: 1.17.1
>            Reporter: Xianxun Ye
>            Priority: Major
>         Attachments: lookup_join_inner_join_type.jpg
>
>
> *How to reproduce:*
> {code:java}
> CREATE TABLE dim (
>   id BIGINT,
>   name STRING,
>   age INT,
>   status BOOLEAN,
>   PRIMARY KEY (id) NOT ENFORCED
> ) WITH (
>   'connector' = 'jdbc',
>   'url' = 'jdbc:mysql://localhost:3306/mydatabase',
>   'table-name' = 'users'
> );
> create table actions (
>   id bigint,
>   proc as proctime(),
>   primary key (id) not enforced
> ) with (
>   'connector' = 'jdbc',
>   'url' = 'jdbc:mysql://localhost:3306/mydatabase',
>   'table-name' = 'actions'
> );
> select
>   *
> from
>   actions
>   left join dim for system_time as of actions.proc on actions.id = dim.id
> where
>   dim.age > 10; {code}
> When running the above SQL, the LookupJoin operator is executed based on 
> InnerJoin, contrary to the SQL's left join.
> If I remove the where condition(dim.age>10), the LookupJoin's joinType is 
> LeftOuterJoin.
> Is this a bug?



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

Reply via email to