You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by izual <iz...@163.com> on 2020/02/26 10:52:42 UTC

How to write a retract table to Kafka?

Hi community:SQL contains aggregate functions, GROUP BY, etc,will generate a RetractStream, which type is DataStream[(Boolean, Row)].
It's not allowed to write to Kafka because kafka table is based on AppendStreamTableSink.


If I only need to write ADD message to Kafka, is it possible to achieve this only by SQL?
What is the classical usage for this? 
tableEnv.toRetractStream[Row](...).filter(_._1).map(_._2).addSink(new KafkaProducer)
or
How to convert a RetractStream to a DataStream, then use SQL to output to Kafka?