Support Questions

Find answers, ask questions, and share your expertise

Streaming SQL Builder - TUMBLING windows and Watermarking

avatar
Explorer

Hi

 

I'm using SSB to create a table from a Kafka topic (using kafka timestamp as watermark eventTimestamp) and doing a TUMBLING windows function to aggregate the data evert 5 minutes and push the data to another table (Kafka Topic).

 

The latest event is always delayed until I push another one.

 

If SSB query is running, and I push an event into Kafka (topic_1) no data will be pushed to topic_2.

if push another event to topic_1 then the previous message gets pushed to topic_2 and so on.

 

Here is a stackoverflow issue of someone who had this exact problem, but I'm unable to do the solution in SSB.

 

Can you help translate this to SSB?

https://stackoverflow.com/questions/58907070/apache-flink-tumbling-window-delayed-result

 

Here is the query:


insert into topic_2
select process_code, window_start, window_end, cast(COUNT(*) as int) as total_events
FROM TABLE(
TUMBLE(
TABLE topic_1,
DESCRIPTOR(eventTimestamp),
INTERVAL '5' minute))
GROUP BY process_code, window_start, window_end

0 REPLIES 0