How to write a retract table to Kafka?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to write a retract table to Kafka?

Izual
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?