[ https://issues.apache.org/jira/browse/FLINK-32252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17729559#comment-17729559 ]
Jark Wu commented on FLINK-32252: --------------------------------- [~tanjialiang] That works as expected. Currently, streaming mode assumes the source is unbounded, so it should never return 0. But I agree the semantics are not consistent between batch and streaming. We have FLINK-12215 and FLINK-18365 to track and improve this. > 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: jdbc-3.1.0 > 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)