You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by 徐涛 <ha...@gmail.com> on 2018/08/20 10:43:00 UTC

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,
Henry