[ https://issues.apache.org/jira/browse/FLINK-32252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17729293#comment-17729293 ]
Benchao Li commented on FLINK-32252: ------------------------------------ The source operator returns 0 rows is expected, does the query return nothing? It should return 1 row for this case. > SELECT COUNT(*) will return nothing when source no data return > -------------------------------------------------------------- > > Key: FLINK-32252 > URL: https://issues.apache.org/jira/browse/FLINK-32252 > Project: Flink > Issue Type: Bug > Components: Table SQL / Planner > Affects Versions: 1.16.1 > Reporter: tanjialiang > Priority: Major > > > mysql source > {code:java} > CREATE TABLE student( > id int primary key auto_increment, > name varchar(32), > age int > ); > INSERT INTO student(name, age) VALUES > ('tanjl',18),('jark',20),('mike',16),('rose',21);{code} > > Flink SQL > {code:java} > CREATE TABLE student ( > `id` INT PRIMARY KEY, > `name` STRING, > `age` INT > ) WITH ( > 'connector' = 'jdbc', > 'url' = 'jdbc:mysql://localhost/test?serverTimezone=UTC', > 'username' = 'root', > 'password' = 'root', > 'table-name' = 'student' > ); > SELECT count(*) FROM student WHERE age < 15;{code} > flink will return nothing because jdbc connector push the filter down(after > flink-connector-jdbc-3.1.0), which make source no data return. > -- This message was sent by Atlassian Jira (v8.20.10#820010)