macdoor615 created FLINK-32333: ---------------------------------- Summary: The same SQL statement, sql-client and sql-gateway give different execution plans Key: FLINK-32333 URL: https://issues.apache.org/jira/browse/FLINK-32333 Project: Flink Issue Type: Bug Components: Table SQL / Client, Table SQL / Gateway Affects Versions: 1.17.1 Reporter: macdoor615
We have a SQL job, like this select ... from prod_kafka.f_alarm_tag_dev /*+ OPTIONS('scan.startup.mode' = 'latest-offset') */ as f left join mysql_bnpmp.gem_bnpmp.f_a_alarm_filter /*+ OPTIONS('lookup.cache.max-rows' = '5000', 'lookup.cache.ttl' = '30s') */ FOR SYSTEM_TIME AS OF f.proctime ff on ff.rule_type = 0 and f.ne_ip = ff.ip We submit to flink 1.17.1 cluster with {*}sql-gateway{*}. We found that the execution plan ignores the filter condition (rule_type=0), and we could not get the expected query results {code:java} +- [1196]:LookupJoin(table=[mysql_bnpmp.gem_bnpmp.f_a_alarm_filter], joinType=[LeftOuterJoin], lookup=[ip=ne_ip], select=[event_id, severity{code} We submit same sql to flink 1.17.1 cluster with {*}sql-client{*}. We found that the execution plan contains the filter condition ( lookup=[rule_type=0, ip=ne_ip], where=[(rule_type = 0)] ), and we got the expected query results {code} +- [3]:LookupJoin(table=[mysql_bnpmp.gem_bnpmp.f_a_alarm_filter], joinType=[LeftOuterJoin], lookup=[rule_type=0, ip=ne_ip], where=[(rule_type = 0)], select=[event_id, severity,{code} We think this issue is related to https://issues.apache.org/jira/browse/FLINK-32321 -- This message was sent by Atlassian Jira (v8.20.10#820010)