How does flink know which data is modified in dynamic table?

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

How does flink know which data is modified in dynamic table?

徐涛
Hi All,
Like the following code,If I use retract stream, I think Flink is able to know which item is modified( if praise has 10000 items now, when one item comes to the stream, only very small amount of data is write to sink) 
	var praiseAggr = tableEnv.sqlQuery(s"SELECT article_id,hll(uid) as PU FROM praise group by article_id )
        tableEnv.registerTable("finalTable", praiseAggr)
	tableEnv.sqlUpdate(s"insert into sinkTableName SELECT * from finalTable")

        But if I use the following sql, by adding a dynamic timestamp field:
var praiseAggr = tableEnv.sqlQuery(s"SELECT article_id,hll(uid) as PU,LOCALTIMESTAMP as update_timestamp FROM praise group by article_id )
      Is the whole table flush to the sink? Or only the incremental value will flush to the sink? Why?

Thanks a lot,
Henry